OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dc5c78
)
tools: Stop converting file if write failed in seq2bseq
author
Szymon Janc
<szymon.janc@tieto.com>
Mon, 13 Jan 2014 08:09:14 +0000
(09:09 +0100)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Mon, 13 Jan 2014 08:48:11 +0000
(10:48 +0200)
If write failed converted file would be broken. This make sure that
user is being informed about it.
tools/seq2bseq.c
patch
|
blob
|
history
diff --git
a/tools/seq2bseq.c
b/tools/seq2bseq.c
index
9797f5f
..
7657a57
100644
(file)
--- a/
tools/seq2bseq.c
+++ b/
tools/seq2bseq.c
@@
-130,6
+130,7
@@
static void convert_file(const char *input_path, const char *output_path)
while (1) {
char *str;
+ int err;
str = fgets(line_buffer, line_size - 1, fp);
if (!str)
@@
-137,7
+138,12
@@
static void convert_file(const char *input_path, const char *output_path)
cur += strlen(str);
- convert_line(fd, str);
+ err = convert_line(fd, str);
+ if (err < 0) {
+ fprintf(stderr, "Failed to convert file (%s)\n",
+ strerror(-err));
+ break;
+ }
}
fclose(fp);