diff options
author | Derrell Lipman <derrell@samba.org> | 2005-05-27 14:38:00 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:00 -0500 |
commit | 54aee75980dd7eb4cc4d5b8e94149fc088a3d7e5 (patch) | |
tree | a90c06785a0548616d270e7c3672c5187d9755db /source3/tdb | |
parent | cc6df2e9cf5b31f83cf88d21457b32712d90f04b (diff) | |
download | samba-54aee75980dd7eb4cc4d5b8e94149fc088a3d7e5.tar.gz samba-54aee75980dd7eb4cc4d5b8e94149fc088a3d7e5.tar.bz2 samba-54aee75980dd7eb4cc4d5b8e94149fc088a3d7e5.zip |
r7025: 1 if not all data is available at the time we go to read a packet, retry
the read using a timeout to ensure that all data for the packet is received.
2 some minor changes to meet coding standards
3 eliminate some compiler warnings
(This used to be commit 7b4d4f6109d815ec70c65564435d7d9bd22f66d9)
Diffstat (limited to 'source3/tdb')
-rw-r--r-- | source3/tdb/tdbtool.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/source3/tdb/tdbtool.c b/source3/tdb/tdbtool.c index 70400e1f37..d9e7b9315a 100644 --- a/source3/tdb/tdbtool.c +++ b/source3/tdb/tdbtool.c @@ -416,14 +416,14 @@ static void info_tdb(void) static char *tdb_getline(const char *prompt) { - static char line[1024]; + static char thisline[1024]; char *p; fputs(prompt, stdout); - line[0] = 0; - p = fgets(line, sizeof(line)-1, stdin); + thisline[0] = 0; + p = fgets(thisline, sizeof(thisline)-1, stdin); if (p) p = strchr(p, '\n'); if (p) *p = 0; - return p?line:NULL; + return p?thisline:NULL; } static int do_delete_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, @@ -560,6 +560,15 @@ static int do_command(void) case CMD_HELP: help(); return 0; + case CMD_CREATE_TDB: + case CMD_OPEN_TDB: + case CMD_SYSTEM: + case CMD_QUIT: + /* + * unhandled commands. cases included here to avoid compiler + * warnings. + */ + return 0; } } @@ -600,19 +609,17 @@ static char *convert_string(char *instring, size_t *sizep) int main(int argc, char *argv[]) { - int i; - - cmdname = ""; + cmdname = (char *) ""; arg1 = NULL; arg1len = 0; arg2 = NULL; arg2len = 0; if (argv[1]) { - cmdname = "open"; + cmdname = (char *) "open"; arg1 = argv[1]; do_command(); - cmdname = ""; + cmdname = (char *) ""; arg1 = NULL; } @@ -622,7 +629,7 @@ int main(int argc, char *argv[]) /* Interactive mode */ while ((cmdname = tdb_getline("tdb> "))) { arg2 = arg1 = NULL; - if (arg1 = strchr((const char *)cmdname,' ')) { + if ((arg1 = strchr((const char *)cmdname,' ')) != NULL) { arg1++; arg2 = arg1; while (*arg2) { |