summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 22:23:07 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 22:23:07 +0200
commitbb33097fb79021c1a47bb4bc45c132020c47d6e4 (patch)
tree8295f619e9721d36fafdf4e4470a559ab6d4ba85 /lib/util
parent06cdfb17b92e69de2995dd7c4a3f417f10230aa7 (diff)
downloadsamba-bb33097fb79021c1a47bb4bc45c132020c47d6e4.tar.gz
samba-bb33097fb79021c1a47bb4bc45c132020c47d6e4.tar.bz2
samba-bb33097fb79021c1a47bb4bc45c132020c47d6e4.zip
Make sure x_fdup compiles on Samba 4.
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/xfile.c3
-rw-r--r--lib/util/xfile.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/util/xfile.c b/lib/util/xfile.c
index b758b1fa9f..7cfb68018e 100644
--- a/lib/util/xfile.c
+++ b/lib/util/xfile.c
@@ -405,11 +405,12 @@ XFILE *x_fdup(const XFILE *f)
return NULL;
}
- ret = SMB_CALLOC_ARRAY(XFILE, 1);
+ ret = malloc_p(XFILE);
if (!ret) {
close(fd);
return NULL;
}
+ memset(ret, 0, sizeof(XFILE));
ret->fd = fd;
ret->open_flags = f->open_flags;
diff --git a/lib/util/xfile.h b/lib/util/xfile.h
index 2cc369d8d8..aa14b7c30a 100644
--- a/lib/util/xfile.h
+++ b/lib/util/xfile.h
@@ -62,7 +62,7 @@ int x_fclose(XFILE *f);
size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f);
/** thank goodness for asprintf() */
-int x_fileno(XFILE *f);
+int x_fileno(const XFILE *f);
/** simulate fflush() */
int x_fflush(XFILE *f);