Commit 21e3c28a authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Oops, get rid of my debugging code

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@386 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent fb62f73a
No related merge requests found
Showing with 0 additions and 10 deletions
+0 -10
...@@ -352,7 +352,6 @@ int write_file(char *name, int tmp) ...@@ -352,7 +352,6 @@ int write_file(char *name, int tmp)
} }
statusbar(_("Could not open file for writing: %s"), statusbar(_("Could not open file for writing: %s"),
strerror(errno)); strerror(errno));
fprintf(stderr, "1\n");
free(realname); free(realname);
return -1; return -1;
} }
...@@ -362,7 +361,6 @@ int write_file(char *name, int tmp) ...@@ -362,7 +361,6 @@ int write_file(char *name, int tmp)
if (fstat(fd, &st2) != 0) { if (fstat(fd, &st2) != 0) {
close(fd); close(fd);
fprintf(stderr, "2\n");
return -1; return -1;
} }
...@@ -384,7 +382,6 @@ int write_file(char *name, int tmp) ...@@ -384,7 +382,6 @@ int write_file(char *name, int tmp)
} }
statusbar(_("Could not open file for writing: %s"), statusbar(_("Could not open file for writing: %s"),
strerror(errno)); strerror(errno));
fprintf(stderr, "3\n");
return -1; return -1;
} }
} }
...@@ -399,7 +396,6 @@ int write_file(char *name, int tmp) ...@@ -399,7 +396,6 @@ int write_file(char *name, int tmp)
if (size == -1) { if (size == -1) {
statusbar(_("Could not open file for writing: %s"), statusbar(_("Could not open file for writing: %s"),
strerror(errno)); strerror(errno));
fprintf(stderr, "4\n");
return -1; return -1;
} else { } else {
#ifdef DEBUG #ifdef DEBUG
...@@ -417,14 +413,12 @@ int write_file(char *name, int tmp) ...@@ -417,14 +413,12 @@ int write_file(char *name, int tmp)
if (size == -1) { if (size == -1) {
statusbar(_("Could not open file for writing: %s"), statusbar(_("Could not open file for writing: %s"),
strerror(errno)); strerror(errno));
fprintf(stderr, "5\n");
return -1; return -1;
} else if (size > 0) { } else if (size > 0) {
size = write(fd, "\n", 1); size = write(fd, "\n", 1);
if (size == -1) { if (size == -1) {
statusbar(_("Could not open file for writing: %s"), statusbar(_("Could not open file for writing: %s"),
strerror(errno)); strerror(errno));
fprintf(stderr, "6\n");
return -1; return -1;
} }
} }
...@@ -434,7 +428,6 @@ int write_file(char *name, int tmp) ...@@ -434,7 +428,6 @@ int write_file(char *name, int tmp)
if (close(fd) == -1) { if (close(fd) == -1) {
statusbar(_("Could not close %s: %s"), realname, strerror(errno)); statusbar(_("Could not close %s: %s"), realname, strerror(errno));
unlink(buf); unlink(buf);
fprintf(stderr, "7\n");
return -1; return -1;
} }
...@@ -456,7 +449,6 @@ int write_file(char *name, int tmp) ...@@ -456,7 +449,6 @@ int write_file(char *name, int tmp)
if (errno != ENOENT) { if (errno != ENOENT) {
statusbar(_("Could not open %s for writing: %s"), statusbar(_("Could not open %s for writing: %s"),
realname, strerror(errno)); realname, strerror(errno));
fprintf(stderr, "8\n");
unlink(buf); unlink(buf);
return -1; return -1;
} }
...@@ -470,13 +462,11 @@ int write_file(char *name, int tmp) ...@@ -470,13 +462,11 @@ int write_file(char *name, int tmp)
statusbar(_("Could not open %s for writing: %s"), statusbar(_("Could not open %s for writing: %s"),
name, strerror(errno)); name, strerror(errno));
unlink(buf); unlink(buf);
fprintf(stderr, "9\n");
return -1; return -1;
} else if (rename(buf, realname) == -1) { /* Try a rename?? */ } else if (rename(buf, realname) == -1) { /* Try a rename?? */
statusbar(_("Could not open %s for writing: %s"), statusbar(_("Could not open %s for writing: %s"),
realname, strerror(errno)); realname, strerror(errno));
unlink(buf); unlink(buf);
fprintf(stderr, "10\n");
return -1; return -1;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment