Skip to content

Commit 8e0dcb8

Browse files
committed
fix comment, use ssize_t for read() return value
1 parent c04ebf9 commit 8e0dcb8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

signals/alarm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ handler(int sig)
3131
int
3232
main(void)
3333
{
34-
int size;
34+
ssize_t size;
3535
char buf[BUFSIZE];
3636
struct sigaction act = { 0 };
3737

@@ -48,10 +48,10 @@ main(void)
4848
warn("interrupted read(), error was");
4949
}
5050

51-
/* Disable the repeating timer. */
51+
/* Disable the timer as read() returned under SECS seconds. */
5252
alarm(0);
5353
if (size > 0) {
54-
printf("Read %d bytes: ", size);
54+
printf("Read %zd bytes: ", size);
5555
/* Without \n it would not print it before write() */
5656
fflush(stdout);
5757
write(1, buf, size);

0 commit comments

Comments
 (0)