From fd619b4fb3a9a5c05df765d2cf57a042a4d5da2d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 15 Sep 2005 19:52:13 +0000 Subject: r10245: Get rid of XFILE in a few places. Add fdprintf() and vfdprintf() helper functions. (This used to be commit 6685009f6af94b088084d69a43bcea5f8335ae57) --- source4/param/generic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/param/generic.c') 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; } -- cgit