Advertisement
rfmonk

perror_func.c

Dec 25th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. void perror(const char *msg);
  4.  
  5. /* a simple way of handling errors from sys calls */
  6. fd = open(pathname, flags, mode);
  7. if (fd == -1) {
  8.     perror("open");
  9.     exit(EXIT_FAILURE);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement