File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
* run like this and then press ^C
3
3
*
4
- * We could have used `jot 10` for generating the sequence
5
- * however it is not available on all systems except FreeBSD/Mac OS X.
6
- *
7
4
* for i in 1 2 3 4 5 6 7 8 9 10; do echo $i; sleep 1; done | \
8
5
* ./a.out | ./a.out | ./a.out | ./a.out
9
6
*
7
+ * Side note: We could have used `jot 10` for generating the sequence however
8
+ * it is not available on all systems except FreeBSD/Mac OS X.
10
9
*/
11
10
12
11
#include <stdio.h>
13
12
#include <unistd.h>
14
13
#include <stdlib.h>
15
14
#include <errno.h>
16
15
#include <signal.h>
16
+ #include <string.h>
17
17
18
18
void
19
19
handler (int yyy )
@@ -42,7 +42,7 @@ main(void)
42
42
write (1 , & c , 1 );
43
43
}
44
44
45
- fprintf (stderr , "%d: error %d \n" , getpid (), errno );
45
+ fprintf (stderr , "%d: error %s \n" , getpid (), strerror ( errno ) );
46
46
47
47
return (1 );
48
48
}
You can’t perform that action at this time.
0 commit comments