diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-09-09 21:05:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:51:19 -0500 |
commit | 96c72e2f8152f2b9e006a392e6e8d1006b9cdd2c (patch) | |
tree | be3250f4adc897d2c8e29a5f4ffec5ef948462c6 /source3/utils | |
parent | 415aa96f09fd708d134eb15a9e8f729ca3eb05c4 (diff) | |
download | samba-96c72e2f8152f2b9e006a392e6e8d1006b9cdd2c.tar.gz samba-96c72e2f8152f2b9e006a392e6e8d1006b9cdd2c.tar.bz2 samba-96c72e2f8152f2b9e006a392e6e8d1006b9cdd2c.zip |
r18310: Add a little test for some gencache routines
Remove unused gencache_set_only
Use CONST_DISCARD instead of SMB_STRDUP
Volker
(This used to be commit 651e7e44e2e56eab81c5fe708f33e6d3918a39f9)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_cache.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/source3/utils/net_cache.c b/source3/utils/net_cache.c index b90befcca2..8f394bea85 100644 --- a/source3/utils/net_cache.c +++ b/source3/utils/net_cache.c @@ -181,47 +181,6 @@ static int net_cache_add(int argc, const char **argv) return -1; } - -/** - * Set new value of an existing entry in the cache. Fail If the entry doesn't - * exist. - * - * @param argv key being searched and new value and timeout to set in the entry - * @return 0 on success, otherwise failure - **/ -static int net_cache_set(int argc, const char **argv) -{ - const char *keystr, *datastr, *timeout_str; - time_t timeout; - - if (argc < 3) { - d_printf("\nUsage: net cache set <key string> <data string> <timeout>\n"); - return -1; - } - - keystr = argv[0]; - datastr = argv[1]; - timeout_str = argv[2]; - - /* parse timeout given in command line */ - timeout = parse_timeout(timeout_str); - if (!timeout) { - d_fprintf(stderr, "Invalid timeout argument.\n"); - return -1; - } - - if (gencache_set_only(keystr, datastr, timeout)) { - d_printf("Cache entry set successfully.\n"); - gencache_shutdown(); - return 0; - } - - d_fprintf(stderr, "Entry couldn't be set. Perhaps there's no such a key.\n"); - gencache_shutdown(); - return -1; -} - - /** * Delete an entry in the cache * @@ -334,7 +293,6 @@ static int net_cache_flush(int argc, const char **argv) static int net_cache_usage(int argc, const char **argv) { d_printf(" net cache add \t add add new cache entry\n"); - d_printf(" net cache set \t set new value for existing cache entry\n"); d_printf(" net cache del \t delete existing cache entry by key\n"); d_printf(" net cache flush \t delete all entries existing in the cache\n"); d_printf(" net cache get \t get cache entry by key\n"); @@ -354,7 +312,6 @@ int net_cache(int argc, const char **argv) { struct functable func[] = { {"add", net_cache_add}, - {"set", net_cache_set}, {"del", net_cache_del}, {"get", net_cache_get}, {"search", net_cache_search}, |