summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/ldbedit.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-23 04:36:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:15 -0500
commit088c24e4e6e72568d4362ac39dc5ff7734782197 (patch)
tree6656169c3c0a5d6f5cfb59828f6d9b11c99b0ac7 /source4/lib/ldb/tools/ldbedit.c
parentd461f97a4acc36f9b98240cc6ce7e87a98fdd7cd (diff)
downloadsamba-088c24e4e6e72568d4362ac39dc5ff7734782197.tar.gz
samba-088c24e4e6e72568d4362ac39dc5ff7734782197.tar.bz2
samba-088c24e4e6e72568d4362ac39dc5ff7734782197.zip
r18840: make these compatible with g++ warnings
(This used to be commit bcfa93954fdb00f500f174cd227e3d9b2ef94fdc)
Diffstat (limited to 'source4/lib/ldb/tools/ldbedit.c')
-rw-r--r--source4/lib/ldb/tools/ldbedit.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index 24df98d728..17ade152b7 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -189,7 +189,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
{
int fd, ret;
FILE *f;
- char template[] = "/tmp/ldbedit.XXXXXX";
+ char file_template[] = "/tmp/ldbedit.XXXXXX";
char *cmd;
struct ldb_ldif *ldif;
struct ldb_message **msgs2 = NULL;
@@ -197,10 +197,10 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
/* write out the original set of messages to a temporary
file */
- fd = mkstemp(template);
+ fd = mkstemp(file_template);
if (fd == -1) {
- perror(template);
+ perror(file_template);
return -1;
}
@@ -209,7 +209,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
if (!f) {
perror("fopen");
close(fd);
- unlink(template);
+ unlink(file_template);
return -1;
}
@@ -219,10 +219,10 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
fclose(f);
- cmd = talloc_asprintf(ldb, "%s %s", editor, template);
+ cmd = talloc_asprintf(ldb, "%s %s", editor, file_template);
if (!cmd) {
- unlink(template);
+ unlink(file_template);
fprintf(stderr, "out of memory\n");
return -1;
}
@@ -232,15 +232,15 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
talloc_free(cmd);
if (ret != 0) {
- unlink(template);
+ unlink(file_template);
fprintf(stderr, "edit with %s failed\n", editor);
return -1;
}
/* read the resulting ldif into msgs2 */
- f = fopen(template, "r");
+ f = fopen(file_template, "r");
if (!f) {
- perror(template);
+ perror(file_template);
return -1;
}
@@ -254,7 +254,7 @@ static int do_edit(struct ldb_context *ldb, struct ldb_message **msgs1, int coun
}
fclose(f);
- unlink(template);
+ unlink(file_template);
return merge_edits(ldb, msgs1, count1, msgs2, count2);
}