History

tinylibmaker: On error situation tempfile was not removed

unknown committed 16 years ago

Commit 27bcc8f1 parent 95bc36a1 file · +3 −0Browse files

Unified · Split

win32/tools/tiny_libmaker.c+3−0
@@ -99,6 +99,7 @@ int main(int argc, char **argv) · 98 unmodified lines
99 if ((fh = fopen(afile, "wb")) == NULL)99 if ((fh = fopen(afile, "wb")) == NULL)
100 {100 {
101 fprintf(stderr, "Can't open file %s \n", afile);101 fprintf(stderr, "Can't open file %s \n", afile);
102 fclose(fo);
102 remove(tfile);103 remove(tfile);
103 return 2;104 return 2;
104 }105 }
@@ -117,6 +118,7 @@ int main(int argc, char **argv) · 12 unmodified lines
117 if ((fi = fopen(argv[iarg], "rb")) == NULL)118 if ((fi = fopen(argv[iarg], "rb")) == NULL)
118 {119 {
119 fprintf(stderr, "Can't open file %s \n", argv[iarg]);120 fprintf(stderr, "Can't open file %s \n", argv[iarg]);
121 fclose(fo);
120 remove(tfile);122 remove(tfile);
121 return 2;123 return 2;
122 }124 }
@@ -133,6 +135,7 @@ int main(int argc, char **argv) · 10 unmodified lines
133 if (ehdr->e_ident[4] != TCC_ELFCLASS)135 if (ehdr->e_ident[4] != TCC_ELFCLASS)
134 {136 {
135 fprintf(stderr, "Unsupported Elf Class: %s\n", argv[iarg]);137 fprintf(stderr, "Unsupported Elf Class: %s\n", argv[iarg]);
138 fclose(fo);
136 remove(tfile);139 remove(tfile);
137 return 2;140 return 2;
138 }141 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t