fd = open(path, O_RDWR);
if (fd < 0) {
- LOG_FATAL("open() failed on %s", path);
+ LOG_FATAL("Could not open %s : %s", path, strerror(errno));
return 0;
}
UTI_FdSetCloexec(fd);
if (time_pps_create(fd, &handle) < 0) {
- LOG_FATAL("time_pps_create() failed on %s", path);
+ LOG_FATAL("time_pps_create() failed on %s : %s", path, strerror(errno));
return 0;
}
if (time_pps_getcap(handle, &mode) < 0) {
- LOG_FATAL("time_pps_getcap() failed on %s", path);
+ LOG_FATAL("time_pps_getcap() failed on %s : %s", path, strerror(errno));
return 0;
}
if (time_pps_getparams(handle, ¶ms) < 0) {
- LOG_FATAL("time_pps_getparams() failed on %s", path);
+ LOG_FATAL("time_pps_getparams() failed on %s : %s", path, strerror(errno));
return 0;
}
}
if (time_pps_setparams(handle, ¶ms) < 0) {
- LOG_FATAL("time_pps_setparams() failed on %s", path);
+ LOG_FATAL("time_pps_setparams() failed on %s : %s", path, strerror(errno));
return 0;
}
id = shmget(SHMKEY + param, sizeof (struct shmTime), IPC_CREAT | perm);
if (id == -1) {
- LOG_FATAL("shmget() failed");
+ LOG_FATAL("shmget() failed : %s", strerror(errno));
return 0;
}
shm = (struct shmTime *)shmat(id, 0, 0);
if ((long)shm == -1) {
- LOG_FATAL("shmat() failed");
+ LOG_FATAL("shmat() failed : %s", strerror(errno));
return 0;
}
s.sun_family = AF_UNIX;
if (snprintf(s.sun_path, sizeof (s.sun_path), "%s", path) >= sizeof (s.sun_path)) {
- LOG_FATAL("path %s is too long", path);
+ LOG_FATAL("Path %s too long", path);
return 0;
}
unlink(path);
if (bind(sockfd, (struct sockaddr *)&s, sizeof (s)) < 0) {
- LOG_FATAL("bind() failed");
+ LOG_FATAL("bind(%s) failed : %s", path, strerror(errno));
return 0;
}