From ed3a28a5f3cc8a6dc15ed707154f6535f5f36d7a Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Thu, 8 Mar 2001 17:52:41 +0000 Subject: [PATCH] merge irix dmapi test changes merge irix changes --- dmapi/src/common/cmd/read_invis.c | 2 - dmapi/src/common/cmd/set_region.c | 2 - dmapi/src/common/cmd/set_return_on_destroy.c | 2 - dmapi/src/common/cmd/write_invis.c | 2 - dmapi/src/common/lib/find_session.c | 2 - dmapi/src/common/lib/print.c | 2 +- dmapi/src/common/lib/util.c | 51 ++++++++++---------- dmapi/src/sample_hsm/migfind.c | 2 - dmapi/src/sample_hsm/mrmean.c | 2 - dmapi/src/simple/dm_create_session.c | 2 +- dmapi/src/simple/dm_destroy_session.c | 2 +- dmapi/src/simple/dm_find_eventmsg.c | 2 +- dmapi/src/simple/dm_getall_sessions.c | 2 +- dmapi/src/simple/dm_getall_tokens.c | 2 +- dmapi/src/simple/dm_query_session.c | 2 +- dmapi/src/suite1/cmd/create_userevent.c | 6 +-- dmapi/src/suite1/cmd/dm_handle.c | 10 +--- dmapi/src/suite1/cmd/downgrade_right.c | 4 +- dmapi/src/suite1/cmd/fd_to_handle.c | 2 + dmapi/src/suite1/cmd/get_allocinfo.c | 31 ------------ dmapi/src/suite1/cmd/get_config_events.c | 3 +- dmapi/src/suite1/cmd/get_dmattr.c | 8 +-- dmapi/src/suite1/cmd/get_eventlist.c | 3 +- dmapi/src/suite1/cmd/get_events.c | 9 +--- dmapi/src/suite1/cmd/get_fileattr.c | 6 +-- dmapi/src/suite1/cmd/get_mountinfo.c | 4 +- dmapi/src/suite1/cmd/get_region.c | 15 +----- dmapi/src/suite1/cmd/getall_disp.c | 6 +-- dmapi/src/suite1/cmd/getall_dmattr.c | 6 +-- dmapi/src/suite1/cmd/handle_to_fshandle.c | 2 - dmapi/src/suite1/cmd/handle_to_path.c | 8 ++- dmapi/src/suite1/cmd/init_service.c | 2 - dmapi/src/suite1/cmd/link_test.c | 2 + dmapi/src/suite1/cmd/make_rt_sparse.c | 5 +- dmapi/src/suite1/cmd/make_sparse.c | 2 + dmapi/src/suite1/cmd/obj_ref_hold.c | 5 +- dmapi/src/suite1/cmd/obj_ref_query.c | 5 +- dmapi/src/suite1/cmd/obj_ref_rele.c | 5 +- dmapi/src/suite1/cmd/path_to_fshandle.c | 2 - dmapi/src/suite1/cmd/path_to_handle.c | 2 - dmapi/src/suite1/cmd/pending.c | 4 -- dmapi/src/suite1/cmd/print_event.c | 7 +-- dmapi/src/suite1/cmd/print_fshandle.c | 13 +++-- dmapi/src/suite1/cmd/probe_hole.c | 7 +-- dmapi/src/suite1/cmd/punch_hole.c | 7 +-- dmapi/src/suite1/cmd/query_right.c | 7 ++- dmapi/src/suite1/cmd/randomize_file.c | 1 + dmapi/src/suite1/cmd/release_right.c | 5 +- dmapi/src/suite1/cmd/remove_dmattr.c | 7 +-- dmapi/src/suite1/cmd/request_right.c | 5 +- dmapi/src/suite1/cmd/respond_event.c | 4 -- dmapi/src/suite1/cmd/rwt.c | 11 ----- dmapi/src/suite1/cmd/security_hole.c | 2 - dmapi/src/suite1/cmd/set_disp.c | 4 +- dmapi/src/suite1/cmd/set_dmattr.c | 7 +-- dmapi/src/suite1/cmd/set_eventlist.c | 5 +- dmapi/src/suite1/cmd/set_fileattr.c | 16 +++--- dmapi/src/suite1/cmd/struct_test.c | 1 + dmapi/src/suite1/cmd/sync_by_handle.c | 7 +-- dmapi/src/suite1/cmd/test_assumption.c | 1 + dmapi/src/suite1/cmd/upgrade_right.c | 5 +- dmapi/src/suite2/src/check_dmapi.c | 3 +- dmapi/src/suite2/src/dm_test_daemon.c | 7 +-- dmapi/src/suite2/src/invis_test.c | 6 +-- dmapi/src/suite2/src/region_test.c | 6 +-- dmapi/src/suite2/src/send_msg.c | 8 +-- dmapi/src/suite2/src/test_dmattr.c | 6 +-- dmapi/src/suite2/src/test_efault.c | 8 ++- dmapi/src/suite2/src/test_eventlist.c | 8 +-- dmapi/src/suite2/src/test_fileattr.c | 15 +++--- dmapi/src/suite2/src/test_hole.c | 8 +-- dmapi/src/suite2/src/test_invis.c | 6 +-- dmapi/src/suite2/src/test_region.c | 16 +----- dmapi/src/suite2/src/test_rights.c | 6 +-- 74 files changed, 152 insertions(+), 309 deletions(-) diff --git a/dmapi/src/common/cmd/read_invis.c b/dmapi/src/common/cmd/read_invis.c index 4caeb712..6b7f3a63 100644 --- a/dmapi/src/common/cmd/read_invis.c +++ b/dmapi/src/common/cmd/read_invis.c @@ -34,11 +34,9 @@ #include -#ifdef linux #include #include #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/common/cmd/set_region.c b/dmapi/src/common/cmd/set_region.c index ce5125a8..44543c3c 100644 --- a/dmapi/src/common/cmd/set_region.c +++ b/dmapi/src/common/cmd/set_region.c @@ -32,10 +32,8 @@ #include -#ifdef linux #include #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/common/cmd/set_return_on_destroy.c b/dmapi/src/common/cmd/set_return_on_destroy.c index 309d210e..3acdf01c 100644 --- a/dmapi/src/common/cmd/set_return_on_destroy.c +++ b/dmapi/src/common/cmd/set_return_on_destroy.c @@ -32,10 +32,8 @@ #include -#ifdef linux #include #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/common/cmd/write_invis.c b/dmapi/src/common/cmd/write_invis.c index cf482488..15cd5cbc 100644 --- a/dmapi/src/common/cmd/write_invis.c +++ b/dmapi/src/common/cmd/write_invis.c @@ -32,11 +32,9 @@ #include -#ifdef linux #include #include #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/common/lib/find_session.c b/dmapi/src/common/lib/find_session.c index 5035351a..a3d2f0ae 100644 --- a/dmapi/src/common/lib/find_session.c +++ b/dmapi/src/common/lib/find_session.c @@ -32,9 +32,7 @@ #include -#ifdef linux #include -#endif /******************************************************************************* * diff --git a/dmapi/src/common/lib/print.c b/dmapi/src/common/lib/print.c index 94525666..89b546ec 100644 --- a/dmapi/src/common/lib/print.c +++ b/dmapi/src/common/lib/print.c @@ -38,8 +38,8 @@ #include -#ifdef linux #include +#ifdef linux #define MAXNAMELEN 256 #endif diff --git a/dmapi/src/common/lib/util.c b/dmapi/src/common/lib/util.c index 84686bcd..f6bedb08 100644 --- a/dmapi/src/common/lib/util.c +++ b/dmapi/src/common/lib/util.c @@ -26,9 +26,10 @@ #include -#ifdef linux #include #include +#ifdef linux +#include #define S_IAMB (S_IRWXU|S_IRWXG|S_IRWXO) #endif @@ -577,16 +578,17 @@ validate_state( if (dmstat->dt_dev != statb.st_dev) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_dev 0x%x, " - "statb.st_dev 0x%x\n", dmstat->dt_dev, - statb.st_dev); + fprintf(stdout, "ERROR:dmstat->dt_dev 0x%llx, " + "statb.st_dev 0x%llx\n", + (uint64_t)dmstat->dt_dev, + (uint64_t)statb.st_dev); } errors++; } if (dmstat->dt_ino != statb.st_ino) { if (report_errors) { fprintf(stdout, "ERROR:dmstat->dt_ino %llx, " -#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32) +#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)) "statb.st_ino %llx\n", #else "statb.st_ino %x\n", @@ -639,16 +641,17 @@ validate_state( } if (dmstat->dt_rdev != statb.st_rdev) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%x, " - "statb.st_rdev 0x%x\n", dmstat->dt_rdev, - statb.st_rdev); + fprintf(stdout, "ERROR:dmstat->dt_rdev 0x%llx, " + "statb.st_rdev 0x%llx\n", + (uint64_t)dmstat->dt_rdev, + (uint64_t)statb.st_rdev); } errors++; } if (dmstat->dt_size != statb.st_size) { if (report_errors) { fprintf(stdout, "ERROR:dmstat->dt_size %lld, " -#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32) +#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)) "statb.st_size %lld\n", #else "statb.st_size %d\n", @@ -659,32 +662,32 @@ validate_state( } if (dmstat->dt_atime != statb.st_atime) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_atime %d, " - "statb.st_atime %d\n", dmstat->dt_atime, + fprintf(stdout, "ERROR:dmstat->dt_atime %ld, " + "statb.st_atime %ld\n", dmstat->dt_atime, statb.st_atime); } errors++; } if (dmstat->dt_mtime != statb.st_mtime) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_mtime %d, " - "statb.st_mtime %d\n", dmstat->dt_mtime, + fprintf(stdout, "ERROR:dmstat->dt_mtime %ld, " + "statb.st_mtime %ld\n", dmstat->dt_mtime, statb.st_mtime); } errors++; } if (dmstat->dt_ctime != statb.st_ctime) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_ctime %d, " - "statb.st_ctime %d\n", dmstat->dt_ctime, + fprintf(stdout, "ERROR:dmstat->dt_ctime %ld, " + "statb.st_ctime %ld\n", dmstat->dt_ctime, statb.st_ctime); } errors++; } if (dmstat->dt_dtime != statb.st_ctime) { if (report_errors) { - fprintf(stdout, "ERROR:dmstat->dt_dtime %d, " - "statb.st_ctime %d\n", dmstat->dt_dtime, + fprintf(stdout, "ERROR:dmstat->dt_dtime %ld, " + "statb.st_ctime %ld\n", dmstat->dt_dtime, statb.st_ctime); } errors++; @@ -692,7 +695,7 @@ validate_state( if (dmstat->dt_blksize != statb.st_blksize) { if (report_errors) { fprintf(stdout, "ERROR:dmstat->dt_blksize %d, " - "statb.st_blksize %d\n", dmstat->dt_blksize, + "statb.st_blksize %ld\n", dmstat->dt_blksize, statb.st_blksize); } errors++; @@ -700,7 +703,7 @@ validate_state( if (dmstat->dt_blocks != statb.st_blocks) { if (report_errors) { fprintf(stdout, "ERROR:dmstat->dt_blocks %lld, " -#if defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32) +#if defined(linux) || (defined(__sgi) && (_MIPS_SIM != _MIPS_SIM_ABI32)) "statb.st_blocks %lld\n", #else "statb.st_blocks %d\n", @@ -890,7 +893,7 @@ print_state( { /* Print all the stat block fields. */ - fprintf(stdout, "dt_dev 0x%x\n", dmstat->dt_dev); + fprintf(stdout, "dt_dev 0x%llx\n", (uint64_t)dmstat->dt_dev); fprintf(stdout, "dt_ino %llx\n", dmstat->dt_ino); fprintf(stdout, "dt_mode (type) %s\n", mode_to_string(dmstat->dt_mode)); @@ -898,7 +901,7 @@ print_state( fprintf(stdout, "dt_nlink %d\n", dmstat->dt_nlink); fprintf(stdout, "dt_uid %d\n", dmstat->dt_uid); fprintf(stdout, "dt_gid %d\n", dmstat->dt_gid); - fprintf(stdout, "dt_rdev 0x%x\n", dmstat->dt_rdev); + fprintf(stdout, "dt_rdev 0x%llx\n", (uint64_t)dmstat->dt_rdev); fprintf(stdout, "dt_size %lld\n", dmstat->dt_size); fprintf(stdout, "dt_atime %s\n", @@ -939,14 +942,14 @@ extern void print_line( dm_stat_t *dmstat) { - fprintf(stdout, "0x%x|", dmstat->dt_dev); + fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_dev); fprintf(stdout, "%llx|", dmstat->dt_ino); fprintf(stdout, "%s|", mode_to_string(dmstat->dt_mode)); fprintf(stdout, "0%o|", dmstat->dt_mode & S_MASK); fprintf(stdout, "%d|", dmstat->dt_nlink); fprintf(stdout, "%d|", dmstat->dt_uid); fprintf(stdout, "%d|", dmstat->dt_gid); - fprintf(stdout, "0x%x|", dmstat->dt_rdev); + fprintf(stdout, "0x%llx|", (uint64_t)dmstat->dt_rdev); fprintf(stdout, "%lld|", dmstat->dt_size); fprintf(stdout, "%s|", date_to_string(dmstat->dt_atime)); @@ -956,13 +959,11 @@ print_line( fprintf(stdout, "%d|", dmstat->dt_blksize); fprintf(stdout, "%lld|", dmstat->dt_blocks); -#ifdef __sgi fprintf(stdout, "%d|", dmstat->dt_xfs_igen); fprintf(stdout, "%s|", xflags_to_string(dmstat->dt_xfs_xflags)); fprintf(stdout, "%d|", dmstat->dt_xfs_extsize); fprintf(stdout, "%d|", dmstat->dt_xfs_extents); fprintf(stdout, "%d|", dmstat->dt_xfs_aextents); -#endif /* Print all other fields. */ diff --git a/dmapi/src/sample_hsm/migfind.c b/dmapi/src/sample_hsm/migfind.c index 350c9bdc..d3718a48 100644 --- a/dmapi/src/sample_hsm/migfind.c +++ b/dmapi/src/sample_hsm/migfind.c @@ -30,9 +30,7 @@ #include -#ifdef linux #include -#endif #define NUMLEN 16 /* arbitrary max len of input size */ #define MAX_K (((u_int)LONG_MAX + 1) / 1024) diff --git a/dmapi/src/sample_hsm/mrmean.c b/dmapi/src/sample_hsm/mrmean.c index 5342a3d2..3c2c71c8 100644 --- a/dmapi/src/sample_hsm/mrmean.c +++ b/dmapi/src/sample_hsm/mrmean.c @@ -25,10 +25,8 @@ #include -#ifdef linux #include #include -#endif extern char *optarg; extern int optind, opterr, optopt; diff --git a/dmapi/src/simple/dm_create_session.c b/dmapi/src/simple/dm_create_session.c index 5ac9b622..690b02e8 100644 --- a/dmapi/src/simple/dm_create_session.c +++ b/dmapi/src/simple/dm_create_session.c @@ -32,9 +32,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/simple/dm_destroy_session.c b/dmapi/src/simple/dm_destroy_session.c index be61dd9e..f4c2bcfd 100644 --- a/dmapi/src/simple/dm_destroy_session.c +++ b/dmapi/src/simple/dm_destroy_session.c @@ -32,9 +32,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/simple/dm_find_eventmsg.c b/dmapi/src/simple/dm_find_eventmsg.c index feaceb91..9c2336a2 100644 --- a/dmapi/src/simple/dm_find_eventmsg.c +++ b/dmapi/src/simple/dm_find_eventmsg.c @@ -32,9 +32,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/simple/dm_getall_sessions.c b/dmapi/src/simple/dm_getall_sessions.c index dbdcea7f..66fba8ba 100644 --- a/dmapi/src/simple/dm_getall_sessions.c +++ b/dmapi/src/simple/dm_getall_sessions.c @@ -34,9 +34,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/simple/dm_getall_tokens.c b/dmapi/src/simple/dm_getall_tokens.c index f091a575..7aaddcc5 100644 --- a/dmapi/src/simple/dm_getall_tokens.c +++ b/dmapi/src/simple/dm_getall_tokens.c @@ -33,9 +33,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/simple/dm_query_session.c b/dmapi/src/simple/dm_query_session.c index f99455a0..e67f7c54 100644 --- a/dmapi/src/simple/dm_query_session.c +++ b/dmapi/src/simple/dm_query_session.c @@ -32,9 +32,9 @@ #include #include #include +#include #ifdef linux #include -#include #else #include #endif diff --git a/dmapi/src/suite1/cmd/create_userevent.c b/dmapi/src/suite1/cmd/create_userevent.c index 721378a4..6c219da5 100644 --- a/dmapi/src/suite1/cmd/create_userevent.c +++ b/dmapi/src/suite1/cmd/create_userevent.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -60,8 +59,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-s sid] string\n", Progname); exit(1); } @@ -77,7 +74,6 @@ main( dm_token_t token; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/dm_handle.c b/dmapi/src/suite1/cmd/dm_handle.c index b69986f5..5a441782 100644 --- a/dmapi/src/suite1/cmd/dm_handle.c +++ b/dmapi/src/suite1/cmd/dm_handle.c @@ -38,9 +38,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- @@ -73,13 +71,6 @@ Tested DMAPI functions are: char *Progname; -static void -usage(void) -{ - fprintf(stderr, "usage:\t%s pathname\n", Progname); - exit(1); -} - int main( @@ -280,4 +271,5 @@ main( dm_handle_free(fshanp1, fshlen1); dm_handle_free(fshanp2, fshlen2); dm_handle_free(fshanp3, fshlen3); + exit(0); } diff --git a/dmapi/src/suite1/cmd/downgrade_right.c b/dmapi/src/suite1/cmd/downgrade_right.c index fb2ef25c..79af4b29 100644 --- a/dmapi/src/suite1/cmd/downgrade_right.c +++ b/dmapi/src/suite1/cmd/downgrade_right.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -149,4 +148,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/fd_to_handle.c b/dmapi/src/suite1/cmd/fd_to_handle.c index 8b7df440..c0b48cfa 100644 --- a/dmapi/src/suite1/cmd/fd_to_handle.c +++ b/dmapi/src/suite1/cmd/fd_to_handle.c @@ -42,6 +42,7 @@ #include +#include static void hantoa( @@ -88,4 +89,5 @@ main( hantoa(hanp, hlen, buffer); fprintf(stdout, "handle %s, path %s\n", buffer, argv[1]); + exit(0); } diff --git a/dmapi/src/suite1/cmd/get_allocinfo.c b/dmapi/src/suite1/cmd/get_allocinfo.c index f6f36601..c3eddac7 100644 --- a/dmapi/src/suite1/cmd/get_allocinfo.c +++ b/dmapi/src/suite1/cmd/get_allocinfo.c @@ -39,9 +39,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- @@ -252,11 +250,7 @@ print_alloc( char *type = NULL; int rc; -#ifdef __sgi fprintf(stdout, "%s: starting offset %lld\n", pathname, startoff); -#else - fprintf(stdout, "%s: starting offset %d\n", pathname, startoff); -#endif /* Allocate space for the number of extents requested by the user. */ @@ -302,32 +296,20 @@ print_alloc( } if (!Dflag) { -#if __sgi fprintf(stdout, "\t%d: [%lld..%lld]: %s", num, -#else - fprintf(stdout, "\t%d: [%d..%d]: %s", num, -#endif extent[i].ex_offset / 512, (extent[i].ex_offset + extent[i].ex_length - 1) / 512, type); if ((extent[i].ex_offset % 512 != 0) || (endoff % 512 != 0)) { -#if __sgi fprintf(stdout, "\t[%lld..%lld]\n", -#else - fprintf(stdout, "\t[%d..%d]\n", -#endif extent[i].ex_offset % 512, (endoff-1) % 512); } else { fprintf(stdout, "\n"); } } else { -#ifdef __sgi fprintf(stdout, "%5s %13lld %13lld\n", -#else - fprintf(stdout, "%5s %13d %13d\n", -#endif type, extent[i].ex_offset, extent[i].ex_length); } @@ -340,22 +322,13 @@ print_alloc( */ if (extent[i].ex_offset != endoff) { -#ifdef __sgi fprintf(stderr, "new extent (%lld)is not " "adjacent to previous one (%lld)\n", -#else - fprintf(stderr, "new extent (%d)is not " - "adjacent to previous one (%d)\n", -#endif extent[i].ex_offset, endoff); return(1); } if (num && (extent[i].ex_offset % 512) != 0) { -#ifdef __sgi fprintf(stderr, "non-initial ex_offset (%lld) " -#else - fprintf(stderr, "non-initial ex_offset (%d) " -#endif "is not a 512-byte multiple\n", extent[i].ex_offset); return(1); @@ -383,11 +356,7 @@ print_alloc( */ if (rc && startoff != endoff) { -#ifdef __sgi fprintf(stderr, "startoff is %lld, should be %lld\n", -#else - fprintf(stderr, "startoff is %d, should be %d\n", -#endif startoff, endoff); return(1); } diff --git a/dmapi/src/suite1/cmd/get_config_events.c b/dmapi/src/suite1/cmd/get_config_events.c index bd6a815f..48e04388 100644 --- a/dmapi/src/suite1/cmd/get_config_events.c +++ b/dmapi/src/suite1/cmd/get_config_events.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/get_dmattr.c b/dmapi/src/suite1/cmd/get_dmattr.c index 7001bda2..3cf454db 100644 --- a/dmapi/src/suite1/cmd/get_dmattr.c +++ b/dmapi/src/suite1/cmd/get_dmattr.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -61,8 +60,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-t token] " "pathname attr\n", Progname); exit(1); @@ -85,7 +82,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; @@ -148,7 +144,7 @@ main( } exit(1); } - fprintf(stdout, "rlenp is %d, value is '%s'\n", rlenp, bufp); + fprintf(stdout, "rlenp is %d, value is '%s'\n", rlenp, (char*)bufp); dm_handle_free(hanp, hlen); exit(0); diff --git a/dmapi/src/suite1/cmd/get_eventlist.c b/dmapi/src/suite1/cmd/get_eventlist.c index 53740fe4..7bc81310 100644 --- a/dmapi/src/suite1/cmd/get_eventlist.c +++ b/dmapi/src/suite1/cmd/get_eventlist.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/get_events.c b/dmapi/src/suite1/cmd/get_events.c index 5e437a1c..583b07e3 100644 --- a/dmapi/src/suite1/cmd/get_events.c +++ b/dmapi/src/suite1/cmd/get_events.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -61,8 +60,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] [-m maxmsgs] [-f] sid\n", Progname); exit(1); @@ -79,14 +76,10 @@ main( u_int flags = 0; void *bufp; size_t buflen = 10000; - void *hanp; - size_t hlen; - char hans1[HANDLE_STR]; u_int maxmsgs = 1; size_t rlenp; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/get_fileattr.c b/dmapi/src/suite1/cmd/get_fileattr.c index e66ae60e..3856ae90 100644 --- a/dmapi/src/suite1/cmd/get_fileattr.c +++ b/dmapi/src/suite1/cmd/get_fileattr.c @@ -35,9 +35,8 @@ #include -#ifdef linux #include -#endif +#include extern int optind; extern int opterr; @@ -62,7 +61,7 @@ main( { dm_sessid_t sid = DM_NO_SESSION; dm_token_t token = DM_NO_TOKEN; - char buffer[500]; +/* char buffer[500];*/ void *hanp; size_t hlen; dm_stat_t dmstat; @@ -166,4 +165,5 @@ main( } XXX Shut off for now. */ } + exit(0); } diff --git a/dmapi/src/suite1/cmd/get_mountinfo.c b/dmapi/src/suite1/cmd/get_mountinfo.c index 763e044a..62e10c0a 100644 --- a/dmapi/src/suite1/cmd/get_mountinfo.c +++ b/dmapi/src/suite1/cmd/get_mountinfo.c @@ -34,6 +34,7 @@ #include #include +#include #include @@ -76,8 +77,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] pathname\n", Progname); exit(1); @@ -98,7 +97,6 @@ main( size_t fshlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/get_region.c b/dmapi/src/suite1/cmd/get_region.c index aa8a6fa2..529a089a 100644 --- a/dmapi/src/suite1/cmd/get_region.c +++ b/dmapi/src/suite1/cmd/get_region.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -57,22 +56,10 @@ extern char *optarg; char *Progname; -static struct { - char *name; - int value; -} rg_events[3] = { - { "DM_REGION_READ", DM_REGION_READ }, - { "DM_REGION_WRITE", DM_REGION_WRITE }, - { "DM_REGION_TRUNCATE", DM_REGION_TRUNCATE } -}; -static int nevents = sizeof(rg_events)/sizeof(rg_events[0]); - static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-n nelem] [-s sid] pathname\n", Progname); exit(1); } diff --git a/dmapi/src/suite1/cmd/getall_disp.c b/dmapi/src/suite1/cmd/getall_disp.c index dd0608e5..36f3a05f 100644 --- a/dmapi/src/suite1/cmd/getall_disp.c +++ b/dmapi/src/suite1/cmd/getall_disp.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -60,8 +59,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] sid\n", Progname); exit(1); @@ -83,7 +80,6 @@ main( size_t rlenp; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/getall_dmattr.c b/dmapi/src/suite1/cmd/getall_dmattr.c index 3c3bc401..22d06967 100644 --- a/dmapi/src/suite1/cmd/getall_dmattr.c +++ b/dmapi/src/suite1/cmd/getall_dmattr.c @@ -32,9 +32,8 @@ #include -#ifdef linux #include -#endif +#include /*--------------------------------------------------------------------------- @@ -60,8 +59,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] pathname\n", Progname); exit(1); @@ -82,7 +79,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/handle_to_fshandle.c b/dmapi/src/suite1/cmd/handle_to_fshandle.c index b7d33dfa..3d0e1298 100644 --- a/dmapi/src/suite1/cmd/handle_to_fshandle.c +++ b/dmapi/src/suite1/cmd/handle_to_fshandle.c @@ -34,9 +34,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/handle_to_path.c b/dmapi/src/suite1/cmd/handle_to_path.c index cae81b6a..70dd4388 100644 --- a/dmapi/src/suite1/cmd/handle_to_path.c +++ b/dmapi/src/suite1/cmd/handle_to_path.c @@ -37,6 +37,11 @@ #include +#include +#ifdef linux +#include +#endif + /*--------------------------------------------------------------------------- Test program used to test the DMAPI function dm_handle_to_path(). The @@ -158,10 +163,11 @@ main( } return(1); } - fprintf(stderr, "rlenp is %d, pathbufp is %s\n", rlenp, pathbufp); + fprintf(stderr, "rlenp is %d, pathbufp is %s\n", rlenp, (char*)pathbufp); if (strlen(pathbufp) + 1 != rlenp) { fprintf(stderr, "rlenp is %d, should be %d\n", rlenp, strlen(pathbufp) + 1); return(1); } + exit(0); } diff --git a/dmapi/src/suite1/cmd/init_service.c b/dmapi/src/suite1/cmd/init_service.c index c9843d2d..453aa10c 100644 --- a/dmapi/src/suite1/cmd/init_service.c +++ b/dmapi/src/suite1/cmd/init_service.c @@ -32,9 +32,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/link_test.c b/dmapi/src/suite1/cmd/link_test.c index e63a2ada..28b0f9ec 100644 --- a/dmapi/src/suite1/cmd/link_test.c +++ b/dmapi/src/suite1/cmd/link_test.c @@ -30,6 +30,7 @@ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ +#include #include /* @@ -162,4 +163,5 @@ main( rc = dm_sync_by_handle(sid, hanp, hlen, token); rc = dm_upgrade_right(sid, hanp, hlen, token); ssrc = dm_write_invis(sid, hanp, hlen, flags, token, off, len, bufp); + exit(0); } diff --git a/dmapi/src/suite1/cmd/make_rt_sparse.c b/dmapi/src/suite1/cmd/make_rt_sparse.c index 078d12bb..ab5a239d 100644 --- a/dmapi/src/suite1/cmd/make_rt_sparse.c +++ b/dmapi/src/suite1/cmd/make_rt_sparse.c @@ -35,9 +35,8 @@ */ #include -/* #include */ -#ifdef linux -#else +#ifdef __sgi +#include #include #include #include diff --git a/dmapi/src/suite1/cmd/make_sparse.c b/dmapi/src/suite1/cmd/make_sparse.c index 0869b3d8..f682038d 100644 --- a/dmapi/src/suite1/cmd/make_sparse.c +++ b/dmapi/src/suite1/cmd/make_sparse.c @@ -42,6 +42,8 @@ #include #include +#include +#include static char * prog; diff --git a/dmapi/src/suite1/cmd/obj_ref_hold.c b/dmapi/src/suite1/cmd/obj_ref_hold.c index e962a1de..5444e876 100644 --- a/dmapi/src/suite1/cmd/obj_ref_hold.c +++ b/dmapi/src/suite1/cmd/obj_ref_hold.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -149,4 +149,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/obj_ref_query.c b/dmapi/src/suite1/cmd/obj_ref_query.c index df4055ea..a59a55f3 100644 --- a/dmapi/src/suite1/cmd/obj_ref_query.c +++ b/dmapi/src/suite1/cmd/obj_ref_query.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -155,4 +155,5 @@ main( fprintf(stdout, "there is no hold\n"); } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/obj_ref_rele.c b/dmapi/src/suite1/cmd/obj_ref_rele.c index ca88bbb6..0537e41d 100644 --- a/dmapi/src/suite1/cmd/obj_ref_rele.c +++ b/dmapi/src/suite1/cmd/obj_ref_rele.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -149,4 +149,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/path_to_fshandle.c b/dmapi/src/suite1/cmd/path_to_fshandle.c index 329dcd79..a2bdafe4 100644 --- a/dmapi/src/suite1/cmd/path_to_fshandle.c +++ b/dmapi/src/suite1/cmd/path_to_fshandle.c @@ -34,9 +34,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/path_to_handle.c b/dmapi/src/suite1/cmd/path_to_handle.c index 162d64af..1ba0188f 100644 --- a/dmapi/src/suite1/cmd/path_to_handle.c +++ b/dmapi/src/suite1/cmd/path_to_handle.c @@ -34,9 +34,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/pending.c b/dmapi/src/suite1/cmd/pending.c index 2c1c0d6d..eb682334 100644 --- a/dmapi/src/suite1/cmd/pending.c +++ b/dmapi/src/suite1/cmd/pending.c @@ -32,9 +32,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- @@ -59,8 +57,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s sid token\n", Progname); exit(1); diff --git a/dmapi/src/suite1/cmd/print_event.c b/dmapi/src/suite1/cmd/print_event.c index 7d009af2..16ec9705 100644 --- a/dmapi/src/suite1/cmd/print_event.c +++ b/dmapi/src/suite1/cmd/print_event.c @@ -38,11 +38,7 @@ #define HDR "%s: token %d sequence %d\n" #define VALS "\t%-15s %s\n" #define VALD "\t%-15s %d\n" -#ifdef __sgi #define VALLLD "\t%-15s %lld\n" -#else -#define VALLLD "\t%-15s %ld\n" -#endif extern int optind; extern int errno; @@ -368,7 +364,7 @@ handle_message( #endif void *hanp1, *hanp2, *namp1, *namp2; u_int hlen1, hlen2, nlen1, nlen2; - char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR]; + char hans1[HANDLE_STR], hans2[HANDLE_STR]; char nams1[MAXNAMELEN], nams2[MAXNAMELEN]; /* @@ -471,6 +467,7 @@ handle_message( "offset", msg_de->de_offset, "length", msg_de->de_length); break; + default: break; } } diff --git a/dmapi/src/suite1/cmd/print_fshandle.c b/dmapi/src/suite1/cmd/print_fshandle.c index 5bfab996..19773846 100644 --- a/dmapi/src/suite1/cmd/print_fshandle.c +++ b/dmapi/src/suite1/cmd/print_fshandle.c @@ -35,8 +35,8 @@ */ #include -#ifdef linux -#else +#include +#ifdef __sgi #include #include #include @@ -69,9 +69,11 @@ main( int argc, char **argv) { -/* xfs_fsop_geom_t geom;*/ +#ifdef __sgi + xfs_fsop_geom_t geom; char *uuid_str; u_int status; +#endif char *name; int fd; void *fshanp; @@ -96,14 +98,15 @@ main( exit(1); } -/* +#ifdef __sgi syssgi(SGI_XFS_FSOPERATIONS, fd, XFS_FS_GEOMETRY, NULL, &geom); uuid_to_string(&geom.uuid, &uuid_str, &status); fprintf(stdout, "fshandle %s, uuid %s, %s\n", buffer, uuid_str, argv[1]); -*/ +#endif fprintf(stdout, "fshandle %s, %s\n", buffer, argv[1]); + exit(0); } diff --git a/dmapi/src/suite1/cmd/probe_hole.c b/dmapi/src/suite1/cmd/probe_hole.c index 4c3f3bc4..779a0a22 100644 --- a/dmapi/src/suite1/cmd/probe_hole.c +++ b/dmapi/src/suite1/cmd/probe_hole.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -62,8 +62,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-o offset] [-l length] " "[-s sid] pathname\n", Progname); exit(1); @@ -85,7 +83,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/punch_hole.c b/dmapi/src/suite1/cmd/punch_hole.c index e1137ede..3553d172 100644 --- a/dmapi/src/suite1/cmd/punch_hole.c +++ b/dmapi/src/suite1/cmd/punch_hole.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -62,8 +62,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-o offset] [-l length] " "[-s sid] pathname\n", Progname); exit(1); @@ -83,7 +81,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/query_right.c b/dmapi/src/suite1/cmd/query_right.c index 7b1251a1..7aebe1c4 100644 --- a/dmapi/src/suite1/cmd/query_right.c +++ b/dmapi/src/suite1/cmd/query_right.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -85,11 +85,9 @@ main( dm_token_t token; dm_right_t right; char *object; - char *rightstr; void *hanp; size_t hlen; int Fflag = 0; - int wflag = 0; char *name; int opt; @@ -154,4 +152,5 @@ main( fprintf(stderr, "right is %s\n", rt_value_to_name(right)); dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/randomize_file.c b/dmapi/src/suite1/cmd/randomize_file.c index c99e382a..75f1bf4d 100644 --- a/dmapi/src/suite1/cmd/randomize_file.c +++ b/dmapi/src/suite1/cmd/randomize_file.c @@ -152,4 +152,5 @@ main( fprintf(stderr, "can't unlink %s\n", path); exit(1); } + exit(0); } diff --git a/dmapi/src/suite1/cmd/release_right.c b/dmapi/src/suite1/cmd/release_right.c index 40849aa1..80780759 100644 --- a/dmapi/src/suite1/cmd/release_right.c +++ b/dmapi/src/suite1/cmd/release_right.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -149,4 +149,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/remove_dmattr.c b/dmapi/src/suite1/cmd/remove_dmattr.c index 163adbef..c8e544e6 100644 --- a/dmapi/src/suite1/cmd/remove_dmattr.c +++ b/dmapi/src/suite1/cmd/remove_dmattr.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -60,8 +60,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-s sid] [-u] pathname attr\n", Progname); exit(1); } @@ -80,7 +78,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/request_right.c b/dmapi/src/suite1/cmd/request_right.c index 3859b38a..aa129c8b 100644 --- a/dmapi/src/suite1/cmd/request_right.c +++ b/dmapi/src/suite1/cmd/request_right.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -174,4 +174,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite1/cmd/respond_event.c b/dmapi/src/suite1/cmd/respond_event.c index a0a361be..b3a58dc4 100644 --- a/dmapi/src/suite1/cmd/respond_event.c +++ b/dmapi/src/suite1/cmd/respond_event.c @@ -32,9 +32,7 @@ #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- @@ -59,8 +57,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s sid token response reterror\n", Progname); exit(1); diff --git a/dmapi/src/suite1/cmd/rwt.c b/dmapi/src/suite1/cmd/rwt.c index 963cef7e..11b4bce1 100644 --- a/dmapi/src/suite1/cmd/rwt.c +++ b/dmapi/src/suite1/cmd/rwt.c @@ -40,9 +40,7 @@ #include #include -#ifdef linux #include -#endif /*--------------------------------------------------------------------------- @@ -81,8 +79,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-r|-w|-t] [-o offset] [-l length] " "pathname\n", Progname); exit(1); @@ -106,7 +102,6 @@ main( int fd; ssize_t rc; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; @@ -164,15 +159,9 @@ main( } if (seek_off != offset) { fprintf(stderr, -#ifdef __sgi "seeked to offset %lld, actually " "arrived at %lld\n", (int64_t)offset, (int64_t)seek_off); -#else - "seeked to offset %d, actually " - "arrived at %d\n", - offset, seek_off); -#endif exit(1); } } diff --git a/dmapi/src/suite1/cmd/security_hole.c b/dmapi/src/suite1/cmd/security_hole.c index 1bfdbdd1..8ced0b11 100644 --- a/dmapi/src/suite1/cmd/security_hole.c +++ b/dmapi/src/suite1/cmd/security_hole.c @@ -35,9 +35,7 @@ #include #include -#ifdef linux #include -#endif /* To read unallocated disk blocks in a filesystem, do diff --git a/dmapi/src/suite1/cmd/set_disp.c b/dmapi/src/suite1/cmd/set_disp.c index 736414ce..d8dfffc4 100644 --- a/dmapi/src/suite1/cmd/set_disp.c +++ b/dmapi/src/suite1/cmd/set_disp.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- diff --git a/dmapi/src/suite1/cmd/set_dmattr.c b/dmapi/src/suite1/cmd/set_dmattr.c index b510eb5f..a1b71a50 100644 --- a/dmapi/src/suite1/cmd/set_dmattr.c +++ b/dmapi/src/suite1/cmd/set_dmattr.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -62,8 +62,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-b buflen] [-s sid] [-u] pathname " "attr value\n", Progname); exit(1); @@ -86,7 +84,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/set_eventlist.c b/dmapi/src/suite1/cmd/set_eventlist.c index 4300bb96..bbc8623a 100644 --- a/dmapi/src/suite1/cmd/set_eventlist.c +++ b/dmapi/src/suite1/cmd/set_eventlist.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -98,7 +98,6 @@ main( u_int maxevent = DM_EVENT_MAX; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/set_fileattr.c b/dmapi/src/suite1/cmd/set_fileattr.c index 1e071aff..4188f576 100644 --- a/dmapi/src/suite1/cmd/set_fileattr.c +++ b/dmapi/src/suite1/cmd/set_fileattr.c @@ -35,9 +35,9 @@ #include -#ifdef linux +#include #include -#endif + extern int optind; @@ -62,11 +62,11 @@ static struct { int daylb; int dayle; } daytab[] = { - 1987, 96, 303, /* new legislation - 1st Sun in April */ - 1976, 119, 303, /* normal Last Sun in Apr - last Sun in Oct */ - 1975, 58, 303, /* 1975: Last Sun in Feb - last Sun in Oct */ - 1974, 5, 333, /* 1974: Jan 6 - last Sun. in Nov */ - 1970, 119, 303, /* start GMT */ + {1987, 96, 303}, /* new legislation - 1st Sun in April */ + {1976, 119, 303}, /* normal Last Sun in Apr - last Sun in Oct */ + {1975, 58, 303}, /* 1975: Last Sun in Feb - last Sun in Oct */ + {1974, 5, 333}, /* 1974: Jan 6 - last Sun. in Nov */ + {1970, 119, 303}, /* start GMT */ }; #define DAYTABSIZE (sizeof(daytab)/sizeof(daytab[0])) @@ -329,7 +329,6 @@ main( char **argv) { dm_sessid_t sid = DM_NO_SESSION; - char buffer[500]; void *hanp; size_t hlen; dm_fileattr_t fileattr; @@ -421,4 +420,5 @@ main( strerror(errno)); exit(1); } + exit(0); } diff --git a/dmapi/src/suite1/cmd/struct_test.c b/dmapi/src/suite1/cmd/struct_test.c index 50ef681f..dd3fe785 100644 --- a/dmapi/src/suite1/cmd/struct_test.c +++ b/dmapi/src/suite1/cmd/struct_test.c @@ -243,4 +243,5 @@ int main( S_NEXT(dm_xstat_t, dx_statinfo); S_NEXT(dm_xstat_t, dx_attrdata); S_END(dm_xstat_t); + exit(0); } diff --git a/dmapi/src/suite1/cmd/sync_by_handle.c b/dmapi/src/suite1/cmd/sync_by_handle.c index 3a248b97..a030c82d 100644 --- a/dmapi/src/suite1/cmd/sync_by_handle.c +++ b/dmapi/src/suite1/cmd/sync_by_handle.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -62,8 +62,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-s sid] pathname\n", Progname); exit(1); } @@ -80,7 +78,6 @@ main( size_t hlen; char *name; int opt; - int i; if (Progname = strrchr(argv[0], '/')) { Progname++; diff --git a/dmapi/src/suite1/cmd/test_assumption.c b/dmapi/src/suite1/cmd/test_assumption.c index a92fd330..3de82377 100644 --- a/dmapi/src/suite1/cmd/test_assumption.c +++ b/dmapi/src/suite1/cmd/test_assumption.c @@ -155,4 +155,5 @@ main( exit(1); } fprintf(stdout, "SUCCESS!\n"); + exit(0); } diff --git a/dmapi/src/suite1/cmd/upgrade_right.c b/dmapi/src/suite1/cmd/upgrade_right.c index 375d8f7c..a6fc48ba 100644 --- a/dmapi/src/suite1/cmd/upgrade_right.c +++ b/dmapi/src/suite1/cmd/upgrade_right.c @@ -32,9 +32,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -149,4 +149,5 @@ main( } dm_handle_free(hanp, hlen); + exit(0); } diff --git a/dmapi/src/suite2/src/check_dmapi.c b/dmapi/src/suite2/src/check_dmapi.c index d6849e74..c8561dbf 100644 --- a/dmapi/src/suite2/src/check_dmapi.c +++ b/dmapi/src/suite2/src/check_dmapi.c @@ -216,8 +216,7 @@ main( else { printf("ERROR: kernel set_disp call failed: (%d) %s\n", errno, strerror(errno)); -/* XXX */ -/* exit(1);*/ + exit(1); } } diff --git a/dmapi/src/suite2/src/dm_test_daemon.c b/dmapi/src/suite2/src/dm_test_daemon.c index 66205175..e47cad2a 100644 --- a/dmapi/src/suite2/src/dm_test_daemon.c +++ b/dmapi/src/suite2/src/dm_test_daemon.c @@ -50,11 +50,7 @@ #define HDR "%s\ntoken :%d\nsequence :%d\n" #define VALS "%-15s:%s\n" #define VALD "%-15s:%d\n" -#ifdef __sgi #define VALLLD "%-15s:%lld\n" -#else -#define VALLLD "%-15s:%ld\n" -#endif extern int optind; extern int errno; @@ -389,7 +385,7 @@ handle_message( #endif void *hanp1, *hanp2, *namp1, *namp2; u_int hlen1, hlen2, nlen1, nlen2; - char hans1[HANDLE_STR], hans2[HANDLE_STR], hans3[HANDLE_STR]; + char hans1[HANDLE_STR], hans2[HANDLE_STR]; char nams1[MAXNAMELEN], nams2[MAXNAMELEN]; void *fs_hanp; size_t fs_hlen; @@ -605,6 +601,7 @@ handle_message( "offset", msg_de->de_offset, "length", msg_de->de_length); break; + default: break; } } diff --git a/dmapi/src/suite2/src/invis_test.c b/dmapi/src/suite2/src/invis_test.c index bfc065ef..cfd657ab 100644 --- a/dmapi/src/suite2/src/invis_test.c +++ b/dmapi/src/suite2/src/invis_test.c @@ -37,9 +37,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -80,8 +80,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-Rrv] [-l len] [-o offset] [-s sid] ls_path pathname\n", Progname); exit(1); diff --git a/dmapi/src/suite2/src/region_test.c b/dmapi/src/suite2/src/region_test.c index e88c2b41..aafd9c51 100644 --- a/dmapi/src/suite2/src/region_test.c +++ b/dmapi/src/suite2/src/region_test.c @@ -35,9 +35,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -73,8 +73,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-Rv] [-s sid] [-l len] [-o offset] ls_path pathname\n", Progname); exit(1); } diff --git a/dmapi/src/suite2/src/send_msg.c b/dmapi/src/suite2/src/send_msg.c index 3c39247e..72275d82 100644 --- a/dmapi/src/suite2/src/send_msg.c +++ b/dmapi/src/suite2/src/send_msg.c @@ -40,9 +40,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -68,8 +68,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-a] [-s sid] string\n", Progname); exit(1); } @@ -82,10 +80,8 @@ main( { dm_sessid_t sid = DM_NO_SESSION; char *string; - dm_token_t token; char *name; int opt; - int i; dm_msgtype_t msgtype = DM_MSGTYPE_SYNC; if (Progname = strrchr(argv[0], '/')) { diff --git a/dmapi/src/suite2/src/test_dmattr.c b/dmapi/src/suite2/src/test_dmattr.c index fa8a6a89..88c430fe 100644 --- a/dmapi/src/suite2/src/test_dmattr.c +++ b/dmapi/src/suite2/src/test_dmattr.c @@ -38,9 +38,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- Automated test of the DMAPI functions: @@ -80,8 +80,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-v] [-n number] [-l length] " "[-s sid] ls_path pathname\n", Progname); exit(1); diff --git a/dmapi/src/suite2/src/test_efault.c b/dmapi/src/suite2/src/test_efault.c index 803da883..22cfa54e 100644 --- a/dmapi/src/suite2/src/test_efault.c +++ b/dmapi/src/suite2/src/test_efault.c @@ -41,9 +41,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- Automated search for EFAULT in the following DMAPI commands: @@ -89,7 +89,6 @@ int main(int argc, char **argv) { dm_sessid_t sid = DM_NO_SESSION; - dm_token_t test_token = DM_NO_TOKEN; void *hanp; size_t hlen; char *name; @@ -98,7 +97,6 @@ main(int argc, char **argv) { char test_file[100]; char command[100]; int opt; - int i=0; if (Progname = strrchr(argv[0], '/')) { Progname++; @@ -155,7 +153,6 @@ main(int argc, char **argv) { { dm_off_t off=0; u_int nelem=1; dm_extent_t extent; - dm_extent_t *extentp; u_int nelem_ret; ERRTEST(EFAULT, "get_allocinfo (bad offp)", @@ -255,5 +252,6 @@ abort_test: printf("EFAULT testing complete.\n"); + exit(0); } diff --git a/dmapi/src/suite2/src/test_eventlist.c b/dmapi/src/suite2/src/test_eventlist.c index 0ba5aa70..6e0eb812 100644 --- a/dmapi/src/suite2/src/test_eventlist.c +++ b/dmapi/src/suite2/src/test_eventlist.c @@ -33,9 +33,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -70,8 +70,6 @@ int check_one_event (dm_sessid_t, void*, size_t, dm_token_t, static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-v] [-s sid] [-t token]" "ls_path directory \n", Progname); /* fprintf(stderr, "possible events are:\n"); @@ -94,11 +92,9 @@ main( char object[128]; void *hanp; size_t hlen; - int Fflag = 0; int Vflag = 0; char *name; int opt; - dm_eventtype_t event; int error; void *fshanp; size_t fshlen; diff --git a/dmapi/src/suite2/src/test_fileattr.c b/dmapi/src/suite2/src/test_fileattr.c index 866f3e39..ff7a5df2 100644 --- a/dmapi/src/suite2/src/test_fileattr.c +++ b/dmapi/src/suite2/src/test_fileattr.c @@ -44,9 +44,9 @@ #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- Automated test of the DMAPI functions: @@ -92,19 +92,19 @@ comp_stat ( dm_stat_t expected, if (found.dt_mode != expected.dt_mode) { fprintf(stderr, "ERROR: get #%d, expected mode %ld, but found %ld\n", - i, expected.dt_mode, found.dt_mode); + i, (long)expected.dt_mode, (long)found.dt_mode); } else good++; if (found.dt_uid != expected.dt_uid) { fprintf(stderr, "ERROR: get #%d, expected uid %ld, but found %ld\n", - i, expected.dt_uid, found.dt_uid); + i, (long)expected.dt_uid, (long)found.dt_uid); } else good++; if (found.dt_gid != expected.dt_gid) { fprintf(stderr, "ERROR: get #%d, expected gid %ld, but found %ld\n", - i, expected.dt_gid, found.dt_gid); + i, (long)expected.dt_gid, (long)found.dt_gid); } else good++; if (found.dt_atime != expected.dt_atime) { @@ -175,7 +175,6 @@ main( char *pathname; char test_file[100]; char command[100]; - int fs_num_files; int num_files=50; dm_stat_t *stat_arr; dm_stat_t dmstat; @@ -190,7 +189,6 @@ main( void *bufp; dm_stat_t *statbuf; int loops=0; - int all_file_count=0; void *fs_hanp; size_t fs_hlen; void *targhanp; @@ -610,7 +608,7 @@ main( } } /*---------------------------------------------------------*/ - { void *p = (void *)(((char *)bufp)+1); + { if (dm_init_attrloc(sid, hanp, hlen, DM_NO_TOKEN, &loc)){ fprintf(stderr, "ERROR: dm_init_attrloc failed with %s.\n", @@ -713,4 +711,5 @@ abort_test: system(command); } printf("File attribute tests complete.\n"); + exit(0); } diff --git a/dmapi/src/suite2/src/test_hole.c b/dmapi/src/suite2/src/test_hole.c index 0e938665..afd1428d 100644 --- a/dmapi/src/suite2/src/test_hole.c +++ b/dmapi/src/suite2/src/test_hole.c @@ -36,9 +36,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -69,8 +69,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-v] [-s sid] ls_path directoryname\n", Progname); exit(1); @@ -95,7 +93,6 @@ main( dm_token_t test_token; char *name; int opt; - int i; int Vflag = 0; char filename[128]; char command[128]; @@ -182,7 +179,6 @@ main( /* Check that dm_probe_hole returns an extent from the next * highest multiple of the block size, to the end of the file */ - i = 0; for (offset = 0; offset < 29604; offset++) { if (dm_probe_hole(sid, hanp, hlen, DM_NO_TOKEN, offset, length, &roff, &rlen)) { diff --git a/dmapi/src/suite2/src/test_invis.c b/dmapi/src/suite2/src/test_invis.c index dada7d02..489a056f 100644 --- a/dmapi/src/suite2/src/test_invis.c +++ b/dmapi/src/suite2/src/test_invis.c @@ -38,9 +38,9 @@ #include #include -#ifdef linux +#include #include -#endif +#include /*--------------------------------------------------------------------------- @@ -79,8 +79,6 @@ char *Progname; static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-v] [-s sid] ls_path pathname\n", Progname); exit(1); diff --git a/dmapi/src/suite2/src/test_region.c b/dmapi/src/suite2/src/test_region.c index e4f76eea..747a1190 100644 --- a/dmapi/src/suite2/src/test_region.c +++ b/dmapi/src/suite2/src/test_region.c @@ -35,9 +35,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- @@ -67,14 +67,6 @@ extern char *optarg; char *Progname; -static struct { - char *name; - int value; -} rg_events[3] = { - { "DM_REGION_READ", DM_REGION_READ }, - { "DM_REGION_WRITE", DM_REGION_WRITE }, - { "DM_REGION_TRUNCATE", DM_REGION_TRUNCATE } -}; u_int reg_flags[8] = {DM_REGION_NOEVENT, DM_REGION_READ, @@ -86,14 +78,10 @@ u_int reg_flags[8] = {DM_REGION_NOEVENT, DM_REGION_READ | DM_REGION_WRITE | DM_REGION_TRUNCATE}; -static int nevents = sizeof(rg_events)/sizeof(rg_events[0]); - static void usage(void) { - int i; - fprintf(stderr, "usage:\t%s [-s sid] ls_path pathname\n", Progname); exit(1); } diff --git a/dmapi/src/suite2/src/test_rights.c b/dmapi/src/suite2/src/test_rights.c index 9300f6aa..a61ba079 100644 --- a/dmapi/src/suite2/src/test_rights.c +++ b/dmapi/src/suite2/src/test_rights.c @@ -41,9 +41,9 @@ #include #include -#ifdef linux +#include #include -#endif + /*--------------------------------------------------------------------------- Automated test of access rights, involving many DMAPI functions @@ -104,7 +104,6 @@ main(int argc, char **argv) { char command[150]; int opt; int i=0; - int error_count=0; if (Progname = strrchr(argv[0], '/')) { Progname++; @@ -293,6 +292,7 @@ abort_test: printf("Access rights testing complete.\n"); + exit(0); } -- 2.30.2