From: <hoo...@ya...> - 2008-07-10 14:25:06
|
Subrata Modak: > Well, Symbols are always better than using direct no.s. Feel free to > update the Patch. Here it is. There were some mistakes in my previous patch. - wrong mode 0644 for mkdir(). - unnecessary to add 0644 for open() since the flag doesn't include O_CREAT (while it does no harm). By this new patch, they are fixed. But I didn't know testcases/kernel/fs/dmapi is not compiled, sigh... Junjiro Okajima ---------------------------------------------------------------------- Index: ltp/lib/write_log.c =================================================================== RCS file: /cvsroot/ltp/ltp/lib/write_log.c,v retrieving revision 1.10 diff -u -p -r1.10 write_log.c --- ltp/lib/write_log.c 3 Jul 2008 10:52:10 -0000 1.10 +++ ltp/lib/write_log.c 10 Jul 2008 13:03:20 -0000 @@ -144,7 +144,7 @@ int mode; */ oflags = O_RDWR; - if ((wfile->w_rfd = open(wfile->w_file, oflags, 0644)) == -1) { + if ((wfile->w_rfd = open(wfile->w_file, oflags)) == -1) { sprintf(Wlog_Error_String, "Could not open write log - open(%s, %#o) failed: %s\n", wfile->w_file, oflags, strerror(errno)); Index: ltp/testcases/ballista/ballista/templates/b_mq_attr.tpl =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/ballista/ballista/templates/b_mq_attr.tpl,v retrieving revision 1.1 diff -u -p -r1.1 b_mq_attr.tpl --- ltp/testcases/ballista/ballista/templates/b_mq_attr.tpl 18 Oct 2004 18:05:01 -0000 1.1 +++ ltp/testcases/ballista/ballista/templates/b_mq_attr.tpl 10 Jul 2008 13:03:26 -0000 @@ -49,6 +49,7 @@ access [ QUEUE,NONBLOCK { + // mode and attr parameters are necessary temp_mqd = mq_open(QUEUE_NAME, O_RDWR|O_CREAT); FILE* logFile = NULL; Index: ltp/testcases/ballista/ballista/templates/b_mqd.tpl =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/ballista/ballista/templates/b_mqd.tpl,v retrieving revision 1.1 diff -u -p -r1.1 b_mqd.tpl --- ltp/testcases/ballista/ballista/templates/b_mqd.tpl 18 Oct 2004 18:05:01 -0000 1.1 +++ ltp/testcases/ballista/ballista/templates/b_mqd.tpl 10 Jul 2008 13:03:26 -0000 @@ -44,6 +44,7 @@ dials access [ { + // mode and attr parameters are necessary temp_mqd = mq_open(QUEUE_NAME, O_RDWR|O_CREAT); FILE* logFile = NULL; Index: ltp/testcases/ballista/ballista/templates/b_mqdSUN.tpl =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/ballista/ballista/templates/b_mqdSUN.tpl,v retrieving revision 1.1 diff -u -p -r1.1 b_mqdSUN.tpl --- ltp/testcases/ballista/ballista/templates/b_mqdSUN.tpl 18 Oct 2004 18:05:01 -0000 1.1 +++ ltp/testcases/ballista/ballista/templates/b_mqdSUN.tpl 10 Jul 2008 13:03:26 -0000 @@ -43,6 +43,7 @@ dials access [ { + // mode and attr parameters are necessary temp_mqd = mq_open(QUEUE_NAME, O_RDWR|O_CREAT); FILE* logFile = NULL; Index: ltp/testcases/ballista/ballista/templates/b_ptr_sem_t.tpl =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/ballista/ballista/templates/b_ptr_sem_t.tpl,v retrieving revision 1.1 diff -u -p -r1.1 b_ptr_sem_t.tpl --- ltp/testcases/ballista/ballista/templates/b_ptr_sem_t.tpl 18 Oct 2004 18:05:20 -0000 1.1 +++ ltp/testcases/ballista/ballista/templates/b_ptr_sem_t.tpl 10 Jul 2008 13:03:26 -0000 @@ -58,6 +58,7 @@ access OPEN, CLOSED, UNLINKED { + // mode and value parameters are necessary temp_sem = sem_open(SEMAPHORE_NAME, O_CREAT); sem = *temp_sem; _theVariable = temp_sem; Index: ltp/testcases/kernel/fs/dmapi/attr.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/attr.c,v retrieving revision 1.3 diff -u -p -r1.3 attr.c --- ltp/testcases/kernel/fs/dmapi/attr.c 3 Jul 2008 10:52:10 -0000 1.3 +++ ltp/testcases/kernel/fs/dmapi/attr.c 10 Jul 2008 13:03:48 -0000 @@ -194,7 +194,7 @@ int main(int argc, char **argv) void *fshanp; size_t fshlen; - fd = open(DUMMY_TMP, O_RDWR | O_CREAT | O_TRUNC, 0644); + fd = open(DUMMY_TMP, O_RDWR | O_CREAT | O_TRUNC, DUMMY_FILE_RW_MODE); if (fd != -1) { for (i = 0; i < (TMP_FILELEN/DUMMY_STRLEN); i++) { if (write(fd, DUMMY_STRING, DUMMY_STRLEN) != DUMMY_STRLEN) { @@ -1070,7 +1070,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -1124,7 +1124,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -2050,7 +2050,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -2653,7 +2653,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -2715,7 +2715,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -3580,7 +3580,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No claen up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4640,7 +4640,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_atime = DUMMY_TIME; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4689,7 +4689,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_mtime = DUMMY_TIME; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4738,7 +4738,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_ctime = DUMMY_TIME; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4792,7 +4792,7 @@ int main(int argc, char **argv) memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); fileattr.fa_dtime = DUMMY_TIME; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4844,7 +4844,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_dtime = DUMMY_TIME; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4893,7 +4893,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_uid = DUMMY_UID; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4942,7 +4942,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_gid = DUMMY_GID; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -4991,7 +4991,7 @@ int main(int argc, char **argv) /* Variation set up */ fileattr.fa_mode = DUMMY_MODE; - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -5874,7 +5874,7 @@ int main(int argc, char **argv) DMEV_SET(DM_EVENT_ATTRIBUTE, eventset); DMEV_SET(DM_EVENT_CLOSE, eventset); DMEV_SET(DM_EVENT_DESTROY, eventset); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -5923,7 +5923,7 @@ int main(int argc, char **argv) dm_stat_t stat; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -5972,7 +5972,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6019,7 +6019,7 @@ int main(int argc, char **argv) dm_stat_t stat; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6068,7 +6068,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6116,7 +6116,7 @@ int main(int argc, char **argv) dm_stat_t stat; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6163,7 +6163,7 @@ int main(int argc, char **argv) int varStatus; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6390,7 +6390,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6428,7 +6428,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6466,7 +6466,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6504,7 +6504,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6541,7 +6541,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6613,7 +6613,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6654,7 +6654,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6695,7 +6695,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6749,7 +6749,7 @@ int main(int argc, char **argv) dm_attrloc_t loc; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6785,7 +6785,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6826,7 +6826,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6867,7 +6867,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6908,7 +6908,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6952,7 +6952,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -6992,7 +6992,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7032,7 +7032,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7077,7 +7077,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7119,7 +7119,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7159,7 +7159,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7237,7 +7237,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7311,7 +7311,7 @@ int main(int argc, char **argv) DMEV_SET(DM_EVENT_ATTRIBUTE, eventset); DMEV_SET(DM_EVENT_CLOSE, eventset); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7384,7 +7384,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7456,7 +7456,7 @@ int main(int argc, char **argv) memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); rc |= dm_init_attrloc(sid, dhanp, dhlen, DM_NO_TOKEN, &loc); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7525,7 +7525,7 @@ int main(int argc, char **argv) memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(attrbuf, ATTR_VALUE, ATTR_VALUELEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7596,7 +7596,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7666,7 +7666,7 @@ int main(int argc, char **argv) memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(attrbuf, ATTR_VALUE, ATTR_VALUELEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7742,7 +7742,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7808,7 +7808,7 @@ int main(int argc, char **argv) memset(buf1, 0, ATTR_LISTLEN); memset(buf2, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -7877,14 +7877,15 @@ int main(int argc, char **argv) memset(buf1, 0, ATTR_LISTLEN); memset(buf2, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); } else if ((rc = system(command)) == -1) { dm_handle_free(dhanp, dhlen); rmdir(DUMMY_SUBDIR); - } else if ((fd = open(DUMMY_SUBDIR_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + } else if ((fd = open(DUMMY_SUBDIR_FILE, O_RDWR | O_CREAT, + DUMMY_FILE_RW_MODE)) == -1) { remove(DUMMY_SUBDIR_FILE); dm_handle_free(dhanp, dhlen); rmdir(DUMMY_SUBDIR); @@ -7951,7 +7952,7 @@ int main(int argc, char **argv) memset(buf1, 0, ATTR_LISTLEN); memset(buf2, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8023,7 +8024,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8101,7 +8102,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8177,7 +8178,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8296,7 +8297,7 @@ int main(int argc, char **argv) memset(buf1, 0, sizeof(buf1)); memset(buf2, 0, sizeof(buf2)); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8390,7 +8391,7 @@ int main(int argc, char **argv) memset(buf2, 0, sizeof(buf2)); memset(buf3, 0, sizeof(buf3)); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8496,7 +8497,7 @@ int main(int argc, char **argv) memset(buf2, 0, sizeof(buf2)); memset(buf3, 0, sizeof(buf3)); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8606,7 +8607,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8685,7 +8686,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8764,7 +8765,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8843,7 +8844,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -8922,7 +8923,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9001,7 +9002,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9080,7 +9081,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, sizeof(buf)); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9149,7 +9150,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9248,7 +9249,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(buf, 0, ATTR_LISTLEN); sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &dhanp, &dhlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9344,7 +9345,7 @@ int main(int argc, char **argv) /* Variation set up */ sprintf(command, "cp %s %s", DUMMY_TMP, DUMMY_SUBDIR_FILE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9384,7 +9385,7 @@ int main(int argc, char **argv) size_t rlen; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9422,7 +9423,7 @@ int main(int argc, char **argv) size_t rlen; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -9766,7 +9767,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -10109,7 +10110,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -10442,7 +10443,7 @@ int main(int argc, char **argv) u_int nelem; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); Index: ltp/testcases/kernel/fs/dmapi/config.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/config.c,v retrieving revision 1.3 diff -u -p -r1.3 config.c --- ltp/testcases/kernel/fs/dmapi/config.c 3 Jul 2008 10:52:10 -0000 1.3 +++ ltp/testcases/kernel/fs/dmapi/config.c 10 Jul 2008 13:03:48 -0000 @@ -63,7 +63,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -99,7 +99,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -135,7 +135,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -170,7 +170,7 @@ int main(int argc, char **argv) size_t hlen; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -223,7 +223,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -259,7 +259,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((rc = mkdir(DUMMY_SUBDIR, 0755)) == -1) { + if ((rc = mkdir(DUMMY_SUBDIR, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DUMMY_SUBDIR, &hanp, &hlen)) == -1) { rmdir(DUMMY_SUBDIR); @@ -293,7 +293,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_fshandle(DUMMY_FILE, &hanp, &hlen)) == -1) { close(fd); @@ -329,7 +329,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -366,7 +366,7 @@ int main(int argc, char **argv) dm_size_t retval; /* Variation set up */ - if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DUMMY_FILE, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); Index: ltp/testcases/kernel/fs/dmapi/disp.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/disp.c,v retrieving revision 1.5 diff -u -p -r1.5 disp.c --- ltp/testcases/kernel/fs/dmapi/disp.c 3 Jul 2008 10:52:10 -0000 1.5 +++ ltp/testcases/kernel/fs/dmapi/disp.c 10 Jul 2008 13:03:48 -0000 @@ -102,7 +102,7 @@ int main(int argc, char **argv) rmdir(DummySubdir); EVENT_DELIVERY_DELAY; - fd = open(DummyFile, O_RDWR | O_CREAT, 0644); + fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE); if (fd != -1) { for (i = 0; i < TMP_FILELEN/DUMMY_STRLEN; i++) { if (write(fd, DUMMY_STRING, DUMMY_STRLEN) != DUMMY_STRLEN) { @@ -125,7 +125,7 @@ int main(int argc, char **argv) DM_EXIT(); } - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_ERR, "creating dummy dir failed! (rc = %d, errno = %d)\n", rc, errno); dm_destroy_session(sid); Index: ltp/testcases/kernel/fs/dmapi/dm_test.h =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/dm_test.h,v retrieving revision 1.2 diff -u -p -r1.2 dm_test.h --- ltp/testcases/kernel/fs/dmapi/dm_test.h 2 Jun 2004 16:14:19 -0000 1.2 +++ ltp/testcases/kernel/fs/dmapi/dm_test.h 10 Jul 2008 13:03:48 -0000 @@ -85,6 +85,10 @@ #define DUMMY_SUBDIR2_LINK "dummy2.dir/dummy.lnk" #define DUMMY_SUBDIR2_SUBDIR "dummy2.dir/dummy.dir" #define DUMMY_TMP "dummy.tmp" +#define DUMMY_FILE_RO_MODE (S_IRUSR | S_IRGRP | S_IROTH) +#define DUMMY_FILE_RW_MODE (DUMMY_FILE_RO_MODE | S_IWUSR) +#define DUMMY_DIR_RO_MODE (DUMMY_FILE_RO_MODE | S_IXUSR | S_IXGRP | S_IXOTH) +#define DUMMY_DIR_RW_MODE (DUMMY_DIR_RO_MODE | S_IWUSR) /* The following constants and macros pertain to DM logging */ #define DMLVL_ERR 1 Index: ltp/testcases/kernel/fs/dmapi/event_am.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/event_am.c,v retrieving revision 1.5 diff -u -p -r1.5 event_am.c --- ltp/testcases/kernel/fs/dmapi/event_am.c 3 Jul 2008 10:52:10 -0000 1.5 +++ ltp/testcases/kernel/fs/dmapi/event_am.c 10 Jul 2008 13:03:48 -0000 @@ -140,7 +140,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -195,7 +195,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -253,7 +253,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((fd1 = open(DummySubdir, O_DIRECTORY)) == -1) { rmdir(DummySubdir); @@ -305,7 +305,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -365,7 +365,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -427,7 +427,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((fd2 = open(DummyFile, O_RDONLY)) == -1) { close(fd1); @@ -507,7 +507,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DummySubdir, &hanp, &hlen)) == -1) { rmdir(DummySubdir); @@ -572,7 +572,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DummySubdir, &hanp, &hlen)) == -1) { rmdir(DummySubdir); @@ -640,7 +640,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((fd1 = open(DummySubdir, O_DIRECTORY)) == -1) { rmdir(DummySubdir); @@ -704,7 +704,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -771,7 +771,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -840,7 +840,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((fd2 = open(DummyFile, O_RDONLY)) == -1) { close(fd1); @@ -905,7 +905,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -939,7 +939,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RO_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -974,7 +974,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((fd1 = open(DummySubdir, O_DIRECTORY)) == -1) { rmdir(DummySubdir); @@ -1026,7 +1026,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -1065,7 +1065,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_ATTRIBUTE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -1104,7 +1104,7 @@ int main(int argc, char **argv) eventExpected = DM_EVENT_CLOSE; eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; - if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, 0644)) == -1) { + if ((fd1 = open(DummyFile, O_RDONLY | O_CREAT, DUMMY_FILE_RO_MODE)) == -1) { /* No clean up */ } else if ((fd2 = open(DummyFile, O_RDONLY)) == -1) { close(fd1); @@ -1181,7 +1181,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1228,7 +1228,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1275,7 +1275,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1322,7 +1322,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1372,7 +1372,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1419,7 +1419,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1467,7 +1467,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1520,7 +1520,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1564,7 +1564,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_path_to_handle(DummySubdir, &hanp, &hlen)) == -1) { rmdir(DummySubdir); @@ -1626,7 +1626,7 @@ int main(int argc, char **argv) memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); memcpy(buf, ATTR_VALUE, ATTR_VALUELEN); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1671,7 +1671,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -1717,7 +1717,7 @@ int main(int argc, char **argv) /* Variation set up */ memset(attrname.an_chars, 0, DM_ATTR_NAME_SIZE); memcpy(attrname.an_chars, ATTR_NAME, DM_ATTR_NAME_SIZE); - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); Index: ltp/testcases/kernel/fs/dmapi/event_an.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/fs/dmapi/event_an.c,v retrieving revision 1.6 diff -u -p -r1.6 event_an.c --- ltp/testcases/kernel/fs/dmapi/event_an.c 3 Jul 2008 10:52:10 -0000 1.6 +++ ltp/testcases/kernel/fs/dmapi/event_an.c 10 Jul 2008 13:03:48 -0000 @@ -166,7 +166,7 @@ int main(int argc, char **argv) /* Variation */ EVENT_DELIVERY_DELAY; DMLOG_PRINT(DMLVL_DEBUG, "mkdir(%s)\n", DummySubdir); - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); DMLOG_PRINT(DMLVL_DEBUG, "mkdir(%s) returned %d\n", DummySubdir, rc); EVENT_DELIVERY_DELAY; if ((varStatus = DMVAR_CHKPASSEXP(0, rc, eventExpected, eventReceived)) == DMSTAT_PASS) { @@ -225,7 +225,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = stat(DummySubdir, &statfs)) == -1) { rmdir(DummySubdir); @@ -284,7 +284,7 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummySubdir, DummySubdir2); EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -357,7 +357,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -431,7 +431,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -493,7 +493,7 @@ int main(int argc, char **argv) /* Variation */ EVENT_DELIVERY_DELAY; DMLOG_PRINT(DMLVL_DEBUG, "open(%s)\n", DummyFile); - fd = open(DummyFile, O_RDWR | O_CREAT, 0644); + fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE); DMLOG_PRINT(DMLVL_DEBUG, "open(%s) returned %d\n", DummyFile, rc); rc = (fd == -1) ? -1 : 0; EVENT_DELIVERY_DELAY; @@ -555,7 +555,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if (((rc = close(fd)) == -1) || ((rc = stat(DummyFile, &statfs)) == -1)) { @@ -616,7 +616,7 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummyFile, DummyFile2); EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -694,7 +694,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -772,7 +772,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = dm_fd_to_handle(fd, &hanp, &hlen)) == -1) { close(fd); @@ -884,7 +884,7 @@ int main(int argc, char **argv) /* Variation */ EVENT_DELIVERY_DELAY; DMLOG_PRINT(DMLVL_DEBUG, "mkdir(%s)\n", DummySubdir); - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); DMLOG_PRINT(DMLVL_DEBUG, "mkdir(%s) returned %d\n", DummySubdir, rc); EVENT_DELIVERY_DELAY; if ((varStatus = DMVAR_CHKPASSEXP(0, rc, eventExpected, eventReceived)) == DMSTAT_PASS) { @@ -943,7 +943,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = stat(DummySubdir, &statfs)) == -1) { rmdir(DummySubdir); @@ -1002,7 +1002,7 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummySubdir, DummySubdir2); EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -1078,9 +1078,9 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummySubdir, DummySubdir2Subdir); EVENT_DELIVERY_DELAY; - if ((rc = mkdir(DummySubdir, 0755)) == -1) { + if ((rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ - } else if ((rc = mkdir(DummySubdir2, 0644)) == -1) { + } else if ((rc = mkdir(DummySubdir2, DUMMY_DIR_RW_MODE)) == -1) { rmdir(DummySubdir); } else if ((rc = dm_path_to_handle(DummySubdir2, &dhanp, &dhlen)) == -1) { rmdir(DummySubdir2); @@ -1164,9 +1164,9 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummySubdir2Subdir, DummySubdir); EVENT_DELIVERY_DELAY; - if ((rc = mkdir(DummySubdir2, 0644)) == -1) { + if ((rc = mkdir(DummySubdir2, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ - } else if ((rc = mkdir(DummySubdir2Subdir, 0644)) == -1) { + } else if ((rc = mkdir(DummySubdir2Subdir, DUMMY_DIR_RW_MODE)) == -1) { rmdir(DummySubdir2); } else if ((rc = dm_path_to_handle(DummySubdir2, &dhanp, &dhlen)) == -1) { rmdir(DummySubdir2Subdir); @@ -1247,7 +1247,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -1321,7 +1321,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - rc = mkdir(DummySubdir, 0755); + rc = mkdir(DummySubdir, DUMMY_DIR_RW_MODE); if (rc == -1) { DMLOG_PRINT(DMLVL_DEBUG, "Unable to set up variation! (errno = %d)\n", errno); DMVAR_SKIP(); @@ -1383,7 +1383,7 @@ int main(int argc, char **argv) /* Variation */ EVENT_DELIVERY_DELAY; DMLOG_PRINT(DMLVL_DEBUG, "open(%s)\n", DummyFile); - fd = open(DummyFile, O_RDWR | O_CREAT, 0644); + fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE); DMLOG_PRINT(DMLVL_DEBUG, "open(%s) returned %d\n", DummyFile, rc); rc = (fd == -1) ? -1 : 0; EVENT_DELIVERY_DELAY; @@ -1445,7 +1445,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if (((rc = close(fd)) == -1) || ((rc = stat(DummyFile, &statfs)) == -1)) { @@ -1506,7 +1506,7 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummyFile, DummyFile2); EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if ((rc = close(fd)) == -1) { remove(DummyFile); @@ -1587,10 +1587,10 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummyFile, DummySubdir2File); EVENT_DELIVERY_DELAY; - if ((fd = open(DummyFile, O_RDWR | O_CREAT, 0644)) == -1) { + if ((fd = open(DummyFile, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { /* No clean up */ } else if (((rc = close(fd)) == -1) || - ((rc = mkdir(DummySubdir2, 0644)) == -1)) { + ((rc = mkdir(DummySubdir2, DUMMY_DIR_RW_MODE)) == -1)) { remove(DummyFile); } else if ((rc = dm_path_to_handle(DummySubdir2, &dhanp, &dhlen)) == -1) { rmdir(DummySubdir2); @@ -1674,9 +1674,9 @@ int main(int argc, char **argv) eventResponse = DM_RESP_CONTINUE; sprintf(command, "mv %s %s", DummySubdir2File, DummyFile); EVENT_DELIVERY_DELAY; - if ((rc = mkdir(DummySubdir2, 0644)) == -1) { + if ((rc = mkdir(DummySubdir2, DUMMY_DIR_RW_MODE)) == -1) { /* No clean up */ - } else if ((fd = open(DummySubdir2File, O_RDWR | O_CREAT, 0644)) == -1) { + } else if ((fd = open(DummySubdir2File, O_RDWR | O_CREAT, DUMMY_FILE_RW_MODE)) == -1) { rmdir(DummySubdir2); } else if ((rc = close(fd)) == -1) { remove(DummySubdir2File); @@ -1760,7 +1760,7 @@ int main(int argc, char **argv) eventReceived = DM_EVENT_INVALID; eventResponse = DM_RESP_CONTINUE; EVENT_DELIVERY_DELAY;... [truncated message content] |