diff options
author | Wilco Baan Hofman <wilco@synlap.(none)> | 2008-04-15 11:52:33 +0200 |
---|---|---|
committer | Wilco Baan Hofman <wilco@synlap.(none)> | 2008-04-15 11:52:33 +0200 |
commit | 0b8d2b3cb779463a1e24039300ac2669862f9b64 (patch) | |
tree | a8e638253e71008f75fbcd84b5fe5ad9717c9ef2 /source4/lib/registry/patchfile_dotreg.c | |
parent | a31b6607f22f6b3e1b354db2f9f611b299a2f7ae (diff) | |
download | samba-0b8d2b3cb779463a1e24039300ac2669862f9b64.tar.gz samba-0b8d2b3cb779463a1e24039300ac2669862f9b64.tar.bz2 samba-0b8d2b3cb779463a1e24039300ac2669862f9b64.zip |
Fixed the patchfile tests and tidy up the patchfile backends.
(This used to be commit 6e9b1e35a269af2eda79356c1525f5413656d648)
Diffstat (limited to 'source4/lib/registry/patchfile_dotreg.c')
-rw-r--r-- | source4/lib/registry/patchfile_dotreg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c index 5aa7e2bab7..1bc9c60753 100644 --- a/source4/lib/registry/patchfile_dotreg.c +++ b/source4/lib/registry/patchfile_dotreg.c @@ -3,7 +3,7 @@ Reading .REG files Copyright (C) Jelmer Vernooij 2004-2007 - Copyright (C) Wilco Baan Hofman 2006 + Copyright (C) Wilco Baan Hofman 2006-2008 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,8 +112,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, data->iconv_convenience = iconv_convenience; if (filename) { - data->fd = open(filename, O_CREAT, 0755); - if (data->fd == -1) { + data->fd = open(filename, O_CREAT|O_WRONLY, 0755); + if (data->fd < 0) { DEBUG(0, ("Unable to open %s\n", filename)); return WERR_BADFILE; } @@ -121,7 +121,7 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename, data->fd = STDOUT_FILENO; } - fdprintf(data->fd, "%s\n", HEADER_STRING); + fdprintf(data->fd, "%s\n\n", HEADER_STRING); *callbacks = talloc(ctx, struct reg_diff_callbacks); |