mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 08:25:40 +02:00
Be more consistent about checking for errors from close()
This commit is contained in:
+4
-1
@@ -102,7 +102,10 @@ void decode(char *fname, int z, unsigned x, unsigned y) {
|
|||||||
} else {
|
} else {
|
||||||
perror("fstat");
|
perror("fstat");
|
||||||
}
|
}
|
||||||
close(fd);
|
if (close(fd) != 0) {
|
||||||
|
perror("close");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
perror(fname);
|
perror(fname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2167,7 +2167,14 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
files_open_at_start = open("/dev/null", O_RDONLY);
|
files_open_at_start = open("/dev/null", O_RDONLY);
|
||||||
close(files_open_at_start);
|
if (files_open_at_start < 0) {
|
||||||
|
perror("open /dev/null");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
if (close(files_open_at_start) != 0) {
|
||||||
|
perror("close");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
if (full_detail <= 0) {
|
if (full_detail <= 0) {
|
||||||
full_detail = 12;
|
full_detail = 12;
|
||||||
|
|||||||
+4
-1
@@ -617,7 +617,10 @@ void readcsv(char *fn, std::vector<std::string> &header, std::map<std::string, s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(f);
|
if (fclose(f) != 0) {
|
||||||
|
perror("fclose");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|||||||
Reference in New Issue
Block a user