merge irix dmapi test changes
authorDean Roehrich <roehrich@sgi.com>
Thu, 8 Mar 2001 17:52:41 +0000 (17:52 +0000)
committerDean Roehrich <roehrich@sgi.com>
Thu, 8 Mar 2001 17:52:41 +0000 (17:52 +0000)
merge irix changes

74 files changed:
dmapi/src/common/cmd/read_invis.c
dmapi/src/common/cmd/set_region.c
dmapi/src/common/cmd/set_return_on_destroy.c
dmapi/src/common/cmd/write_invis.c
dmapi/src/common/lib/find_session.c
dmapi/src/common/lib/print.c
dmapi/src/common/lib/util.c
dmapi/src/sample_hsm/migfind.c
dmapi/src/sample_hsm/mrmean.c
dmapi/src/simple/dm_create_session.c
dmapi/src/simple/dm_destroy_session.c
dmapi/src/simple/dm_find_eventmsg.c
dmapi/src/simple/dm_getall_sessions.c
dmapi/src/simple/dm_getall_tokens.c
dmapi/src/simple/dm_query_session.c
dmapi/src/suite1/cmd/create_userevent.c
dmapi/src/suite1/cmd/dm_handle.c
dmapi/src/suite1/cmd/downgrade_right.c
dmapi/src/suite1/cmd/fd_to_handle.c
dmapi/src/suite1/cmd/get_allocinfo.c
dmapi/src/suite1/cmd/get_config_events.c
dmapi/src/suite1/cmd/get_dmattr.c
dmapi/src/suite1/cmd/get_eventlist.c
dmapi/src/suite1/cmd/get_events.c
dmapi/src/suite1/cmd/get_fileattr.c
dmapi/src/suite1/cmd/get_mountinfo.c
dmapi/src/suite1/cmd/get_region.c
dmapi/src/suite1/cmd/getall_disp.c
dmapi/src/suite1/cmd/getall_dmattr.c
dmapi/src/suite1/cmd/handle_to_fshandle.c
dmapi/src/suite1/cmd/handle_to_path.c
dmapi/src/suite1/cmd/init_service.c
dmapi/src/suite1/cmd/link_test.c
dmapi/src/suite1/cmd/make_rt_sparse.c
dmapi/src/suite1/cmd/make_sparse.c
dmapi/src/suite1/cmd/obj_ref_hold.c
dmapi/src/suite1/cmd/obj_ref_query.c
dmapi/src/suite1/cmd/obj_ref_rele.c
dmapi/src/suite1/cmd/path_to_fshandle.c
dmapi/src/suite1/cmd/path_to_handle.c
dmapi/src/suite1/cmd/pending.c
dmapi/src/suite1/cmd/print_event.c
dmapi/src/suite1/cmd/print_fshandle.c
dmapi/src/suite1/cmd/probe_hole.c
dmapi/src/suite1/cmd/punch_hole.c
dmapi/src/suite1/cmd/query_right.c
dmapi/src/suite1/cmd/randomize_file.c
dmapi/src/suite1/cmd/release_right.c
dmapi/src/suite1/cmd/remove_dmattr.c
dmapi/src/suite1/cmd/request_right.c
dmapi/src/suite1/cmd/respond_event.c
dmapi/src/suite1/cmd/rwt.c
dmapi/src/suite1/cmd/security_hole.c
dmapi/src/suite1/cmd/set_disp.c
dmapi/src/suite1/cmd/set_dmattr.c
dmapi/src/suite1/cmd/set_eventlist.c
dmapi/src/suite1/cmd/set_fileattr.c
dmapi/src/suite1/cmd/struct_test.c
dmapi/src/suite1/cmd/sync_by_handle.c
dmapi/src/suite1/cmd/test_assumption.c
dmapi/src/suite1/cmd/upgrade_right.c
dmapi/src/suite2/src/check_dmapi.c
dmapi/src/suite2/src/dm_test_daemon.c
dmapi/src/suite2/src/invis_test.c
dmapi/src/suite2/src/region_test.c
dmapi/src/suite2/src/send_msg.c
dmapi/src/suite2/src/test_dmattr.c
dmapi/src/suite2/src/test_efault.c
dmapi/src/suite2/src/test_eventlist.c
dmapi/src/suite2/src/test_fileattr.c
dmapi/src/suite2/src/test_hole.c
dmapi/src/suite2/src/test_invis.c
dmapi/src/suite2/src/test_region.c
dmapi/src/suite2/src/test_rights.c

index 4caeb712a6819bdadbb4a63bddd84dcbfb14fc9a..6b7f3a638b1db0db9faaed3a765c616820b37d9d 100644 (file)
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
 #include <malloc.h>
 #include <unistd.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index ce5125a8434e0fe3548548bb2a8f5f986e4b9bdf..44543c3c1f4be52bd17e965fdd912165e6b50c04 100644 (file)
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
 #include <getopt.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index 309d210ef043b19e6f1a879f71d9dba07ef44f8f..3acdf01c804782ab0dafd76ff6f5806caf7ab7ee 100644 (file)
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
 #include <getopt.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index cf482488afb88db0c9eced2f8455e170db62cc3d..15cd5cbc97e430cead4bfca634c0c4e7e123d568 100644 (file)
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
 #include <malloc.h>
 #include <getopt.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index 5035351a435d6dfb0982ba7cc5ee3a0b27922562..a3d2f0aecf3376de6cb0546664afabfe2cd7e223 100644 (file)
@@ -32,9 +32,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*******************************************************************************
 *
index 9452566651bc324b948272816650e50ae4f496b8..89b546ec70a3f7f499463ccba858b3b21daa6e83 100644 (file)
@@ -38,8 +38,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
+#ifdef linux
 #define MAXNAMELEN 256
 #endif
 
index 84686bcd12941983acac7083ce7ea371a8cdbd33..f6bedb085d5302a949ae949b854b43cba470e494 100644 (file)
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
 #include <time.h>
+#ifdef linux
+#include <stdint.h>
 #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. */
 
index 350c9bdc8153ed95c117465b3a26a91004cb5d3c..d3718a4845783ed70ffa1c6a5cd4665189da5225 100644 (file)
@@ -30,9 +30,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <getopt.h>
-#endif
 
 #define NUMLEN 16              /* arbitrary max len of input size */
 #define MAX_K   (((u_int)LONG_MAX + 1) / 1024)
index 5342a3d2ff055d1edd8e5ce3038b10a3877d9cc2..3c2c71c8622f4b722fea0d9cc5cd8e1f5dfdde17 100644 (file)
 
 #include <lib/dmport.h>
 
-#ifdef linux
 #include <string.h>
 #include <getopt.h>
-#endif
 
 extern char    *optarg;
 extern int      optind, opterr, optopt;
index 5ac9b6229ba468115ca4e48a6c3b50672aa4e556..690b02e8727ead330ca2fb022450245a32386b56 100644 (file)
@@ -32,9 +32,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/errno.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index be61dd9e63c8422b9cccd4a74412ae201458450a..f4c2bcfd0bd37c70ebac10f9c4274613d7a3a994 100644 (file)
@@ -32,9 +32,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/errno.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index feaceb91a23309f81d726d6fb5c711ffd1d6458a..9c2336a2427e17e41fd6a8af7654bcac37bec0ad 100644 (file)
@@ -32,9 +32,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/errno.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index dbdcea7f2f6012fa4100a4a414c5f141798705bb..66fba8ba2a902ac1966866f7ad9466d8523a311f 100644 (file)
@@ -34,9 +34,9 @@
 #include <sys/errno.h>
 #include <string.h>
 #include <malloc.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index f091a57569600830953ed61b5c715c3c6d0e45ac..7aaddcc56d50941b3a1ce7691c77b49fe525a3a6 100644 (file)
@@ -33,9 +33,9 @@
 #include <stdlib.h>
 #include <sys/errno.h>
 #include <malloc.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index f99455a06b7c378c695a8ecd8fb02597272c81b2..e67f7c54eabfc8412ffcf83a8bc8fe3e792b9b8e 100644 (file)
@@ -32,9 +32,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/errno.h>
+#include <getopt.h>
 #ifdef linux
 #include <dmapi.h>
-#include <getopt.h>
 #else
 #include <sys/dmi.h>
 #endif
index 721378a4565a1e19b7a87e71f8596922ae71564d..6c219da53fe5c4077754175b34913a1d8f6778ec 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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++;
index b69986f50002aa6cdb342d4368ebb18aafc187b7..5a44178228819c283fd3212468ad1fc6233124fd 100644 (file)
@@ -38,9 +38,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#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);
 }
index fb2ef25c7f14c2f18ff3f6df5d60bf8002d9335c..79af4b29bf50e8c75672a815e2456fb350302af3 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -149,4 +148,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index 8b7df44043175128a7976d4de1c8c12e6355fa16..c0b48cfaad7e060d8bc729dbb78d908a4eca1fa7 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <lib/dmport.h>
 
+#include <string.h>
 
 static void
 hantoa(
@@ -88,4 +89,5 @@ main(
        hantoa(hanp, hlen, buffer);
 
        fprintf(stdout, "handle %s, path %s\n", buffer, argv[1]);
+       exit(0);
 }
index f6f3660140d2f6449cdd8e944a61fe16f4a9f646..c3eddac7c0864023cc7abf3d0dd6c5028e293e76 100644 (file)
@@ -39,9 +39,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#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);
                }
index bd6a815f06c00d6febab95688df7b0e96fe8fbd4..48e0438858fa455d15663cb47dc220abe510ec28 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
index 7001bda2d3bbbc18942b9cd57eb685d486ad95b5..3cf454dbc78fe3e833a2e14080cf7d315b8365e1 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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);
index 53740fe4bc085154b6185318fc9940d14f14c837..7bc81310d73f74e6722f0030bc8f023f010552e7 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
index 5e437a1c37dbf074d734e15f32dce54625522a24..583b07e3ccf9078c26ab9c160766d9818799a937 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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++;
index e66ae60ebd53edd59177098f081684237ab163c2..3856ae905f56d79af8d469b1d0f1d7b9c118c9a0 100644 (file)
@@ -35,9 +35,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 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);
 }
index 763e044ab05714df893ba90bba7bf8554a72dd15..62e10c0ab885135dd6c2fa0eeeace6e2aec47960 100644 (file)
@@ -34,6 +34,7 @@
 #include <sys/param.h>
 
 #include <string.h>
+#include <getopt.h>
 
 #include <lib/hsm.h>
 
@@ -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++;
index aa8a6fa2551f605c6e2fd25cb816157e617b8b5e..529a089a512b23103f82958e72b759062e5757b3 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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);
 }
index dd0608e595102e74a70afe94af11a79b19c5fe0b..36f3a05f9d6cc47aaac2d68051647975b1d351b4 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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++;
index 3c3bc4018b8b9bfcf1464e22028987d57acdef9c..22d06967e5c2b8ba2147a0196bfbb74e37fef71f 100644 (file)
@@ -32,9 +32,8 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
+#include <getopt.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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++;
index b7d33dfa60b00f4bf7b9d03e163913f8c10da619..3d0e1298406ecd1968a74f8a66e42192e2791586 100644 (file)
@@ -34,9 +34,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index cae81b6a342c75ed3a5cce701b118f1f1f332431..70dd43889eff6937d9f609966bdc914d8a3d4ef5 100644 (file)
 
 #include <lib/dmport.h>
 
+#include <getopt.h>
+#ifdef linux
+#include <xfs/handle.h>
+#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);
 }
index c9843d2d02b6eb8d2e43f98ec2ff1dcc296d32b3..453aa10c7663aaf2c0ea0b3bf5a7534d3a86e798 100644 (file)
@@ -32,9 +32,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index e63a2adaac1ea76a8cdb4c35c07ac7955e714271..28b0f9ece4a1bec4ad641362d0b80a3b8001298f 100644 (file)
@@ -30,6 +30,7 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
+#include <stdlib.h>
 #include <lib/dmport.h>
 
 /*
@@ -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);
 }
index 078d12bbad340f8967e36d06162d0d7b16674063..ab5a239d43a77bc4c2021fbdc9abfc8989fe9eb9 100644 (file)
@@ -35,9 +35,8 @@
  */
 
 #include <sys/types.h>
-/* #include <sys/fs/xfs_itable.h> */
-#ifdef linux
-#else
+#ifdef __sgi
+#include <sys/fs/xfs_itable.h>
 #include <sys/syssgi.h>
 #include <sys/uuid.h>
 #include <sys/fs/xfs_fsops.h>
index 0869b3d80dd3c880bb6309b3f46568adea3687c2..f682038dded2c857be36be60ae01978e612c67fd 100644 (file)
@@ -42,6 +42,8 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include <stdlib.h>
+#include <string.h>
 
 static char *  prog;
 
index e962a1ded391c5cf09309072d318e9164a28481e..5444e87652cfcc4e059e967e6ccefa291b9efd1b 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -149,4 +149,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index df4055ea7a72d6ab651047e8b15e7848a79c1dcc..a59a55f3b7dcc879758a795a75518ab8be3f5710 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -155,4 +155,5 @@ main(
                fprintf(stdout, "there is no hold\n");
        }
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index ca88bbb6451b292db8c582a710df6e2eb14de7d6..0537e41d215c9fab5f944f6913ae1e1e4c688f7f 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -149,4 +149,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index 329dcd791cc21074d5343fe35aa4cff1cf8e57e9..a2bdafe4a069a024d290bcd7a20b98a496e4c2b6 100644 (file)
@@ -34,9 +34,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index 162d64af523c13a54b68b019b8675c58581fb859..1ba0188f395cfd592a8c35cf177eccd699abf71e 100644 (file)
@@ -34,9 +34,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
index 2c1c0d6d93e8bb417483b2ca0dc9603a0b3cb70f..eb68233405a4aff0b224219216d0be93f540eb16 100644 (file)
@@ -32,9 +32,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*---------------------------------------------------------------------------
 
@@ -59,8 +57,6 @@ char  *Progname;
 static void
 usage(void)
 {
-       int     i;
-
        fprintf(stderr, "usage:\t%s sid token\n",
                Progname);
        exit(1);
index 7d009af2329f7d59745a1ee64498204cd2b08671..16ec97058da32c287b7e3e85233845dd6a1c23e0 100644 (file)
 #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;
     }
   }
 
index 5bfab99678a1aed45f338f6a7382282f49ed785f..19773846410765ca607af9526236d9ca7c67bd9d 100644 (file)
@@ -35,8 +35,8 @@
 */
 
 #include <sys/types.h>
-#ifdef linux
-#else
+#include <string.h>
+#ifdef __sgi
 #include <sys/syssgi.h>
 #include <sys/uuid.h>
 #include <sys/fs/xfs_fsops.h>
@@ -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);
 }
index 4c3f3bc40ea38d83b88d2d472eaf88ff04e469ec..779a0a229a998f5204b358ab4f4107c79c9c3787 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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++;
index e1137ede5e2af39dc24882bf9e48be7144302871..3553d172cec6d5e12b0f5fb73e4dc9880a67e2cf 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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++;
index 7b1251a14ab4575d677e05bb0783dd1832909270..7aebe1c41de7a151b0a323979cc400399450ed28 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }
index c99e382a5705b3be9d805d5cf417d4640e925b78..75f1bf4d4a7e29067961c48091f776c8c7fec668 100644 (file)
@@ -152,4 +152,5 @@ main(
                fprintf(stderr, "can't unlink %s\n", path);
                exit(1);
        }
+       exit(0);
 }
index 40849aa1fc728ce3750a37309c6ff16b5b50eba5..80780759cb20d1be6f1cb1ab9b5e966288482b53 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -149,4 +149,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index 163adbef9000a034de188783b94a05739d2b8cbc..c8e544e687f878a5ab1703b76dffd8e145ff9f2f 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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++;
index 3859b38a9726e87e8937d605db0890baf01bde55..aa129c8b80f9ed1a605af3833d910aaa49a126a7 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 
 /*---------------------------------------------------------------------------
@@ -174,4 +174,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index a0a361bee3cd26de7d2c2aa9ed1b5f259be0cdb4..b3a58dc414b7b211f0cf7fbd2b75a20b52ba64ee 100644 (file)
@@ -32,9 +32,7 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
 #include <string.h>
-#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);
index 963cef7e45b1353431953058d700b261d8495be0..11b4bce11ef834725bb3217a19ff19bb0c8c4577 100644 (file)
@@ -40,9 +40,7 @@
 #include <strings.h>
 #include <unistd.h>
 
-#ifdef linux
 #include <string.h>
-#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);
                }
        }
index 1bfdbdd136002227f32cdc45a0c957e12ce67133..8ced0b11215f910a3ab7cc23bc70a0edef8f0636 100644 (file)
@@ -35,9 +35,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#ifdef linux
 #include <string.h>
-#endif
 
 /*
        To read unallocated disk blocks in a filesystem, do
index 736414cea8d4dc120af939c4820a0ff1ee26424e..d8dfffc49f704e8b9b2a78fee959d27c628ffcc2 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
index b510eb5fef26cf1c51219f322d039a5e18d449f5..a1b71a508aa6c77517fb615f1e9bce9e89fa4345 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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++;
index 4300bb9662dae15e7672638d52576695983f65e2..bbc8623a9e3f0b139a42195b6f062f2768c5bb3b 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -98,7 +98,6 @@ main(
        u_int           maxevent = DM_EVENT_MAX;
        char            *name;
        int             opt;
-       int             i;
 
        if (Progname = strrchr(argv[0], '/')) {
                Progname++;
index 1e071aff53112fd608a7a615e2d18f8701aadc79..4188f5769a492432bd62395752a8e767f28f922e 100644 (file)
@@ -35,9 +35,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }
index 50ef681f714882ed559197511c12b93d5f934f79..dd3fe78539c1d7bfa713d433abb587f7b90a41c6 100644 (file)
@@ -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);
 }
index 3a248b97d21675c5edb41345b1b9e9e142ec6704..a030c82dfbaee55d3e70c85a4b3809995d38f892 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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++;
index a92fd3307800fabe260f851576eeb0d7c4dcd6b8..3de823777c7ca23aca16077249af389e5180ab37 100644 (file)
@@ -155,4 +155,5 @@ main(
                exit(1);
        }
        fprintf(stdout, "SUCCESS!\n");
+       exit(0);
 }
index 375d8f7cab3eef006370738c5112c8f251dfc3e1..a6fc48ba630e470062817d5ca9a75ff9b253924f 100644 (file)
@@ -32,9 +32,9 @@
 
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+
 
 /*---------------------------------------------------------------------------
 
@@ -149,4 +149,5 @@ main(
        }
 
        dm_handle_free(hanp, hlen);
+       exit(0);
 }
index d6849e7469621df5c8328ac3da29b2a79eb3aaaf..c8561dbf901a648282804f3c15f2031b45c7cd60 100644 (file)
@@ -216,8 +216,7 @@ main(
          else {
            printf("ERROR: kernel set_disp call failed: (%d) %s\n", 
                   errno, strerror(errno));
-/* XXX */
-/*         exit(1);*/
+           exit(1);
          }
        }
 
index 6620517557a8d2411db0616286b49a3768c03509..e47cad2a699f1e7d03c0e1d70071fb898c88647f 100644 (file)
 #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;
     }
   }
 
index bfc065efbfbe577dbc40ede94a874b712220693b..cfd657ab43b19fd77e4f80eecf6c264bd00c40f4 100644 (file)
@@ -37,9 +37,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
index e88c2b415ed6ff6749893849873a370025ec560d..aafd9c5109c6688c81e203100ff941b6a7e2cc74 100644 (file)
@@ -35,9 +35,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }
index 3c39247ea05a3a8de3350aa261657f1bc21aea1f..72275d82005a64c58bf4c2ada6dd792e0618a5db 100644 (file)
@@ -40,9 +40,9 @@
 #include <lib/dmport.h>
 #include <lib/hsm.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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], '/')) {
index fa8a6a89999fae52eee5f467ee672ac67a0000a8..88c430fe638210605665fb5ee538e9d658ae3922 100644 (file)
@@ -38,9 +38,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
index 803da883283ffac9c8e699614f1917d0bd7ac4ae..22cfa54e55c340a9ef05510f917e10cf7fd1af5c 100644 (file)
@@ -41,9 +41,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }
 
index 0ba5aa707260dcc35824b99b3f440b245cc339f7..6e0eb81219065f0c9eb85f4f5fa024c0b830a984 100644 (file)
@@ -33,9 +33,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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;
index 866f3e397b192cfde701091669766047acb62dce..ff7a5df28d75c9fad18e36cca21f2138522cb58f 100644 (file)
@@ -44,9 +44,9 @@
 
 #include <unistd.h>
 
-#ifdef linux
+#include <time.h>
 #include <string.h>
-#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);
 }
index 0e938665c51a6c14edaac42e106baf4d3cc4d90d..afd1428d20572b836592e1629388318442fe9de1 100644 (file)
@@ -36,9 +36,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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)) {
index dada7d026c8fdc852ff501c18be929a321f77d7a..489a056fdfdacd70839155d083e2f5c8b1a4c49d 100644 (file)
@@ -38,9 +38,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#endif
+#include <time.h>
 
 /*---------------------------------------------------------------------------
 
@@ -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);
index e4f76eeaeb765ba0e5c490d48cc13c85376ff4c0..747a119009740971d30ddb8c6acdc533a48b384e 100644 (file)
@@ -35,9 +35,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }
index 9300f6aa9d0d64c9b54678f433d1cee1f5150684..a61ba07909d54aade295e4aa04710a4d8e035399 100644 (file)
@@ -41,9 +41,9 @@
 #include <lib/hsm.h>
 #include <lib/errtest.h>
 
-#ifdef linux
+#include <getopt.h>
 #include <string.h>
-#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);
 }