summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-15 19:52:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:11 -0500
commitfd619b4fb3a9a5c05df765d2cf57a042a4d5da2d (patch)
tree404c1910d83b1dfb5828f1559a92597815df3a2d /source4/param
parenta9e08ba474e4712d121bdce3960fe579f8d68bca (diff)
downloadsamba-fd619b4fb3a9a5c05df765d2cf57a042a4d5da2d.tar.gz
samba-fd619b4fb3a9a5c05df765d2cf57a042a4d5da2d.tar.bz2
samba-fd619b4fb3a9a5c05df765d2cf57a042a4d5da2d.zip
r10245: Get rid of XFILE in a few places.
Add fdprintf() and vfdprintf() helper functions. (This used to be commit 6685009f6af94b088084d69a43bcea5f8335ae57)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/generic.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/param/generic.c b/source4/param/generic.c
index b6d2fd0449..adf1eb0b31 100644
--- a/source4/param/generic.c
+++ b/source4/param/generic.c
@@ -242,28 +242,28 @@ int param_read(struct param_context *ctx, const char *fn)
int param_write(struct param_context *ctx, const char *fn)
{
- XFILE *file;
+ int file;
struct param_section *section;
if (fn == NULL || ctx == NULL)
return -1;
- file = x_fopen(fn, O_WRONLY|O_CREAT, 0755);
+ file = open(fn, O_WRONLY|O_CREAT, 0755);
- if (file == NULL)
+ if (file == -1)
return -1;
for (section = ctx->sections; section; section = section->next) {
struct param *param;
- x_fprintf(file, "[%s]\n", section->name);
+ fdprintf(file, "[%s]\n", section->name);
for (param = section->parameters; param; param = param->next) {
- x_fprintf(file, "\t%s = %s\n", param->name, param->value);
+ fdprintf(file, "\t%s = %s\n", param->name, param->value);
}
- x_fprintf(file, "\n");
+ fdprintf(file, "\n");
}
- x_fclose(file);
+ close(file);
return 0;
}