Change error messages

This commit is contained in:
zenon 2018-06-07 18:13:37 +02:00
parent 834f3f7bf7
commit 829cc3cb3a

View File

@ -85,10 +85,11 @@ int strToInt(char *str)
char *endptr;
long val;
errno = 0;
val = strtol(str, &endptr, 10);
if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) ||
(errno != 0)) {
perror(pname);
perror("[./generator] strtol");
return -2;
}
if (val < INT_MIN || val > INT_MAX) {
@ -314,7 +315,7 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
shmfd = shm_open(SHM_NAME, O_RDWR | O_CREAT, PERMISSION);
shmfd = shm_open(SHM_NAME, O_RDWR, PERMISSION);
if (shmfd == -1) {
perror("[./generator] shm_open");
exit(EXIT_FAILURE);