match_tag = name2tag(argv[0]);
if (match_tag < 0) {
fprintf(stderr, "Tag \"%s\" unknown\n", argv[0]);
- exit (2);
+ exit(2);
}
i = regcomp(&match_re, argv[1], REG_EXTENDED | REG_NOSUB);
if (i) {
char buf[BUFSIZ];
regerror(i, &match_re, buf, sizeof buf);
fprintf(stderr, "%s\n", buf);
- exit (2);
+ exit(2);
}
}
if (!b_flag) {
fd = open(w_arg, flags, 0644);
if (fd < 0) {
perror(w_arg);
- exit (1);
+ exit(1);
}
return (fd);
}
reopen = 0;
}
}
- exit (0);
+ exit(0);
}
/*--------------------------------------------------------------------*/
int
main(int argc, char **argv)
{
- int i, c;
+ int c;
int a_flag = 0, D_flag = 0, o_flag = 0;
const char *n_arg = NULL;
const char *P_arg = NULL;
if (o_flag)
do_order(vd, argc - optind, argv + optind);
- while (1) {
- i = VSL_Dispatch(vd, VSL_H_Print, stdout);
- if (i == 0)
- fflush(stdout);
- else if (i < 0)
+ while (VSL_Dispatch(vd, VSL_H_Print, stdout) >= 0) {
+ if (fflush(stdout) != 0) {
+ perror("stdout");
break;
+ }
}
if (pfh != NULL)