Revision 5e03b78d mainbox/util.c

View differences:

mainbox/util.c
1 1
#include "util.h"
2
#include "log.h"
2 3
#include <stdlib.h>
3 4
#include <stdio.h>
4 5
#include <unistd.h>
......
12 13
  
13 14
  fd = open(filename, O_RDONLY);
14 15
  if (fd < 0) {
15
    perror("open");
16
    log_perror("open");
16 17
    return NULL;
17 18
  }
18 19

  
......
38 39
      close(fd);
39 40
      return str;
40 41
    } else if (nread < 0) {
41
      perror("read");
42
      log_perror("read");
42 43
      free(str);
43 44
      close(fd);
44 45
      return NULL;

Also available in: Unified diff