summaryrefslogtreecommitdiff
path: root/source3/torture/nbio.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-02 11:38:24 -0800
committerJeremy Allison <jra@samba.org>2009-01-02 11:38:24 -0800
commit2234173220c51c2e37818149ddf41421672904c0 (patch)
treef41a3f462234afa7f9bbb434e357c9b3a0fbbdad /source3/torture/nbio.c
parent9c92cb763653644e129b0777b3f8fc2f333bb7c6 (diff)
downloadsamba-2234173220c51c2e37818149ddf41421672904c0.tar.gz
samba-2234173220c51c2e37818149ddf41421672904c0.tar.bz2
samba-2234173220c51c2e37818149ddf41421672904c0.zip
Fix warnings in make test code.
Jeremy.
Diffstat (limited to 'source3/torture/nbio.c')
-rw-r--r--source3/torture/nbio.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 81d0eb816b..a010c80985 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -111,7 +111,9 @@ static void sigsegv(int sig)
printf("segv at line %d\n", line_count);
slprintf(line, sizeof(line), "/usr/X11R6/bin/xterm -e gdb /proc/%d/exe %d",
(int)getpid(), (int)getpid());
- system(line);
+ if (system(line) == -1) {
+ printf("system() failed\n");
+ }
exit(1);
}
@@ -280,10 +282,16 @@ static void delete_fn(const char *mnt, file_info *finfo, const char *name, void
n = SMB_STRDUP(name);
n[strlen(n)-1] = 0;
- asprintf(&s, "%s%s", n, finfo->name);
+ if (asprintf(&s, "%s%s", n, finfo->name) == -1) {
+ printf("asprintf failed\n");
+ return;
+ }
if (finfo->mode & aDIR) {
char *s2;
- asprintf(&s2, "%s\\*", s);
+ if (asprintf(&s2, "%s\\*", s) == -1) {
+ printf("asprintf failed\n");
+ return;
+ }
cli_list(c, s2, aDIR, delete_fn, NULL);
nb_rmdir(s);
} else {
@@ -297,7 +305,10 @@ static void delete_fn(const char *mnt, file_info *finfo, const char *name, void
void nb_deltree(const char *dname)
{
char *mask;
- asprintf(&mask, "%s\\*", dname);
+ if (asprintf(&mask, "%s\\*", dname) == -1) {
+ printf("asprintf failed\n");
+ return;
+ }
total_deleted = 0;
cli_list(c, mask, aDIR, delete_fn, NULL);