projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d79a6d
)
Add support for `-' file to read from stdin
author
Aaron Carroll
<aaronc@cse.unsw.edu.au>
Thu, 27 Sep 2007 07:03:55 +0000
(09:03 +0200)
committer
Jens Axboe
<jens.axboe@oracle.com>
Thu, 27 Sep 2007 07:03:55 +0000
(09:03 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c
patch
|
blob
|
blame
|
history
diff --git
a/init.c
b/init.c
index 84cb2d261251062a50cf4a1a6c875e4cd87edb97..45bd92fd8a3ef0fc04fcd95b54f13e60aa28a72d 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-571,7
+571,11
@@
static int parse_jobs_ini(char *file, int stonewall_flag)
int ret = 0, stonewall;
int first_sect = 1;
- f = fopen(file, "r");
+ if (!strcmp(file, "-"))
+ f = stdin;
+ else
+ f = fopen(file, "r");
+
if (!f) {
perror("fopen job file");
return 1;
@@
-665,7
+669,8
@@
static int parse_jobs_ini(char *file, int stonewall_flag)
free(string);
free(name);
- fclose(f);
+ if (f != stdin)
+ fclose(f);
return ret;
}