debug_log("type : %d", sessiontype);
if (sessiontype < MM_SESSION_TYPE_MEDIA || sessiontype >= MM_SESSION_TYPE_NUM) {
- debug_error("Invalid argument %d",sessiontype);
+ debug_error("Invalid argument %d", sessiontype);
return MM_ERROR_INVALID_ARGUMENT;
}
}
debug_log("[current] session_type: %d, session_option: %x", ltype, loption);
- if (update_type == MM_SESSION_UPDATE_TYPE_ADD) {
+ if (update_type == MM_SESSION_UPDATE_TYPE_ADD)
loption |= options;
- } else if (update_type == MM_SESSION_UPDATE_TYPE_REMOVE) {
+ else if (update_type == MM_SESSION_UPDATE_TYPE_REMOVE)
loption &= ~options;
- }
result = _mm_session_util_write_information(-1, ltype, loption);
if (result) {
/* Check monitor handle */
result = _mm_session_util_delete_information(-1);
- if(result != MM_ERROR_NONE)
+ if (result != MM_ERROR_NONE)
return result;
debug_fleave();
pid_t mypid;
char filename[MAX_FILE_LENGTH];
- if(app_pid == -1)
+ if (app_pid == -1)
mypid = getpid();
else
mypid = (pid_t)app_pid;
////// DELETE SESSION TYPE /////////
snprintf(filename, sizeof(filename)-1, "/tmp/mm_session_%d", mypid);
- if(-1 == unlink(filename))
+ if (-1 == unlink(filename))
return MM_ERROR_FILE_NOT_FOUND;
////// DELETE SESSION TYPE /////////
int fd = -1;
char filename[MAX_FILE_LENGTH];
- if(sessiontype < MM_SESSION_TYPE_MEDIA || sessiontype >= MM_SESSION_TYPE_NUM) {
+ if (sessiontype < MM_SESSION_TYPE_MEDIA || sessiontype >= MM_SESSION_TYPE_NUM)
return MM_ERROR_INVALID_ARGUMENT;
- }
- if(app_pid == -1)
+ if (app_pid == -1)
mypid = getpid();
else
mypid = (pid_t)app_pid;
////// WRITE SESSION TYPE /////////
snprintf(filename, sizeof(filename)-1, "/tmp/mm_session_%d", mypid);
- fd = open(filename, O_WRONLY | O_CREAT, 0644 );
- if(fd < 0) {
- debug_error("open() failed with %d",errno);
+ fd = open(filename, O_WRONLY | O_CREAT, 064);
+ if (fd < 0) {
+ debug_error("open() failed with %d", errno);
return MM_ERROR_FILE_WRITE;
}
sessiontype = sessiontype << 16;
write(fd, &sessiontype, sizeof(int));
- if(0 > fchmod (fd, 00777)) {
+ if (0 > fchmod(fd, 00777))
debug_error("fchmod failed with %d", errno);
- } else {
+ else
debug_warning("write sessiontype(%d) to /tmp/mm_session_%d", sessiontype >> 16, mypid);
- }
+
close(fd);
////// WRITE SESSION TYPE /////////
debug_fenter();
- if(sessiontype == NULL)
+ if (sessiontype == NULL)
return MM_ERROR_INVALID_ARGUMENT;
- if(app_pid == -1)
+ if (app_pid == -1)
mypid = getpid();
else
mypid = (pid_t)app_pid;
////// READ SESSION TYPE /////////
snprintf(filename, sizeof(filename)-1, "/tmp/mm_session_%d", mypid);
fd = open(filename, O_RDONLY);
- if(fd < 0) {
+ if (fd < 0)
return MM_ERROR_INVALID_HANDLE;
- }
+
read(fd, sessiontype, sizeof(int));
*sessiontype = *sessiontype >> 16;
debug_warning("read sessiontype(%d) from /tmp/mm_session_%d", *sessiontype, mypid);
(session_type < MM_SESSION_TYPE_MEDIA || session_type >= MM_SESSION_TYPE_NUM)) {
return MM_ERROR_INVALID_ARGUMENT;
}
- if(flags < 0) {
+ if (flags < 0)
return MM_ERROR_INVALID_ARGUMENT;
- }
- if(app_pid == -1) {
+ if (app_pid == -1)
mypid = getpid();
- } else {
+ else
mypid = (pid_t)app_pid;
- }
////// WRITE SESSION INFO /////////
snprintf(filename, sizeof(filename)-1, "/tmp/mm_session_%d", mypid);
- fd = open(filename, O_WRONLY | O_CREAT, 0644 );
- if(fd < 0) {
- debug_error("open() failed with %d",errno);
+ fd = open(filename, O_WRONLY | O_CREAT, 0644);
+ if (fd < 0) {
+ debug_error("open() failed with %d", errno);
return MM_ERROR_FILE_WRITE;
}
result_info = (flags) | (session_type << 16);
write(fd, &result_info, sizeof(int));
- if (0 > fchmod (fd, 00777)) {
+ if (0 > fchmod(fd, 00777))
debug_error("fchmod failed with %d", errno);
- } else {
+ else
debug_warning("write session information(%x) to /tmp/mm_session_%d", result_info, mypid);
- }
close(fd);
////// WRITE SESSION INFO /////////
debug_fenter();
- if(session_type == NULL || flags == NULL) {
+ if (session_type == NULL || flags == NULL)
return MM_ERROR_INVALID_ARGUMENT;
- }
- if(app_pid == -1) {
+ if (app_pid == -1)
mypid = getpid();
- } else {
+ else
mypid = (pid_t)app_pid;
- }
////// READ SESSION INFO /////////
snprintf(filename, sizeof(filename)-1, "/tmp/mm_session_%d", mypid);
fd = open(filename, O_RDONLY);
- if(fd < 0) {
+ if (fd < 0)
return MM_ERROR_INVALID_HANDLE;
- }
read(fd, &result_info, sizeof(int));
*session_type = result_info >> 16;
*flags = result_info & 0x0000ffff;
* @return This function returns MM_ERROR_NONE on success, or negative value
* with error code.
* @remark This function is only for internal implementation do not use this at application
- * Session type is unique for each application.
- * if application want to change session type, Finish session first and Init again
+ * Session type is unique for each application.
+ * if application want to change session type, Finish session first and Init again
* @see _mm_session_util_delete_information _mm_session_util_read_type
* @since
*/
* @return This function returns MM_ERROR_NONE on success, or negative value
* with error code.
* @remark Session type is unique for each application.
- * if application want to change session type, Finish session first and Init again
+ * if application want to change session type, Finish session first and Init again
* @see _mm_session_util_write_type _mm_session_util_delete_information
* @since
*/
* @return This function returns MM_ERROR_NONE on success, or negative value
* with error code.
* @remark This function is only for internal implementation do not use this at application
- * Session type and Session option are unique for each application.
+ * Session type and Session option are unique for each application.
* @see _mm_session_util_delete_information _mm_session_util_read_information
* @since
*/