diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-03-14 19:55:29 +1100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-03-15 10:38:25 -0700 |
commit | 346407443e6210da9c7335df7b898d96ff74c0e3 (patch) | |
tree | a4c9e7ef4c94d78cb6abeb85716be09d4d0a863f /lib/ntdb/tools/ntdbtorture.c | |
parent | 29dfc94ca312523c5682235f642fb49030abd995 (diff) | |
download | samba-346407443e6210da9c7335df7b898d96ff74c0e3.tar.gz samba-346407443e6210da9c7335df7b898d96ff74c0e3.tar.xz samba-346407443e6210da9c7335df7b898d96ff74c0e3.zip |
ntdb: Cast getpid() result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/ntdb/tools/ntdbtorture.c')
-rw-r--r-- | lib/ntdb/tools/ntdbtorture.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ntdb/tools/ntdbtorture.c b/lib/ntdb/tools/ntdbtorture.c index 717f5dd1f50..3bcf3200f2c 100644 --- a/lib/ntdb/tools/ntdbtorture.c +++ b/lib/ntdb/tools/ntdbtorture.c @@ -61,7 +61,7 @@ static void ntdb_log(struct ntdb_context *ntdb, { char str[200]; signal(SIGUSR1, SIG_IGN); - sprintf(str,"xterm -e gdb /proc/%d/exe %d", getpid(), getpid()); + sprintf(str,"xterm -e gdb /proc/%u/exe %u", (unsigned int)getpid(), (unsigned int)getpid()); system(str); } #endif @@ -74,7 +74,7 @@ static void segv_handler(int sig, siginfo_t *info, void *p) char string[100]; sprintf(string, "%u: death at %p (map_ptr %p, map_size %zu)\n", - getpid(), info->si_addr, db->file->map_ptr, + (unsigned int)getpid(), info->si_addr, db->file->map_ptr, (size_t)db->file->map_size); if (write(2, string, strlen(string)) > 0) sleep(60); @@ -85,7 +85,7 @@ static void warn_on_err(enum NTDB_ERROR e, struct ntdb_context *ntdb, const char *why) { if (e != NTDB_SUCCESS) { - fprintf(stderr, "%u:%s:%s\n", getpid(), why, + fprintf(stderr, "%u:%s:%s\n", (unsigned int)getpid(), why, ntdb ? ntdb_errorstr(e) : "(no ntdb)"); error_count++; } @@ -271,14 +271,14 @@ static int run_child(const char *filename, int i, int seed, unsigned num_loops, db = ntdb_open(filename, ntdb_flags, O_RDWR | O_CREAT, 0600, &log_attr); if (!db) { - fprintf(stderr, "%u:%s:%s\n", getpid(), filename, + fprintf(stderr, "%u:%s:%s\n", (unsigned int)getpid(), filename, "db open failed"); exit(1); } #if 0 if (i == 0) { - printf("pid %i\n", getpid()); + printf("pid %u\n", (unsigned int)getpid()); sleep(9); } else sleep(10); @@ -527,7 +527,7 @@ done: db = ntdb_open(test_ntdb, NTDB_DEFAULT, O_RDWR | O_CREAT, 0600, &log_attr); if (!db) { - fprintf(stderr, "%u:%s:%s\n", getpid(), test_ntdb, + fprintf(stderr, "%u:%s:%s\n", (unsigned int)getpid(), test_ntdb, "db open failed"); exit(1); } |