summaryrefslogtreecommitdiff
path: root/source3/utils/net_cache.c
diff options
context:
space:
mode:
authorLars Müller <lmuelle@samba.org>2006-01-17 21:22:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:09 -0500
commitc42be9fd38556a1cc2e16c8d763a592beb863806 (patch)
treee69234055238ca6996dac2c153ad0c3e44f1e134 /source3/utils/net_cache.c
parentf7519540090b2f47259f72d81b267b3e7a1a8950 (diff)
downloadsamba-c42be9fd38556a1cc2e16c8d763a592beb863806.tar.gz
r12986: Use d_fprintf(stderr, ...) for any error message in net.
All 'usage' messages are still printed to stdout. Fix some compiler warnings for system() calls where we didn't used the return code. Add appropriate error messages and return with the error code we got from system() or NT_STATUS_UNSUCCESSFUL. (This used to be commit f650e3bdafc4c6bcd7eb4bcf8b6b885b979919eb)
Diffstat (limited to 'source3/utils/net_cache.c')
-rw-r--r--source3/utils/net_cache.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/utils/net_cache.c b/source3/utils/net_cache.c
index 6bbab1c8177..0c107a5f01d 100644
--- a/source3/utils/net_cache.c
+++ b/source3/utils/net_cache.c
@@ -64,7 +64,7 @@ static void delete_cache_entry(const char* keystr, const char* datastr,
const time_t timeout, void* dptr)
{
if (!gencache_del(keystr))
- d_printf("Couldn't delete entry! key = %s\n", keystr);
+ d_fprintf(stderr, "Couldn't delete entry! key = %s\n", keystr);
}
@@ -147,7 +147,7 @@ static int net_cache_add(int argc, const char **argv)
/* parse timeout given in command line */
timeout = parse_timeout(timeout_str);
if (!timeout) {
- d_printf("Invalid timeout argument.\n");
+ d_fprintf(stderr, "Invalid timeout argument.\n");
return -1;
}
@@ -157,7 +157,7 @@ static int net_cache_add(int argc, const char **argv)
return 0;
}
- d_printf("Entry couldn't be added. Perhaps there's already such a key.\n");
+ d_fprintf(stderr, "Entry couldn't be added. Perhaps there's already such a key.\n");
gencache_shutdown();
return -1;
}
@@ -187,7 +187,7 @@ static int net_cache_set(int argc, const char **argv)
/* parse timeout given in command line */
timeout = parse_timeout(timeout_str);
if (!timeout) {
- d_printf("Invalid timeout argument.\n");
+ d_fprintf(stderr, "Invalid timeout argument.\n");
return -1;
}
@@ -197,7 +197,7 @@ static int net_cache_set(int argc, const char **argv)
return 0;
}
- d_printf("Entry couldn't be set. Perhaps there's no such a key.\n");
+ d_fprintf(stderr, "Entry couldn't be set. Perhaps there's no such a key.\n");
gencache_shutdown();
return -1;
}
@@ -223,7 +223,7 @@ static int net_cache_del(int argc, const char **argv)
return 0;
}
- d_printf("Couldn't delete specified entry\n");
+ d_fprintf(stderr, "Couldn't delete specified entry\n");
return -1;
}
@@ -250,7 +250,7 @@ static int net_cache_get(int argc, const char **argv)
return 0;
}
- d_printf("Failed to find entry\n");
+ d_fprintf(stderr, "Failed to find entry\n");
return -1;
}