*size = PAGE_ALIGN(*size);
result = buf->shmid = shmget(getpid(), *size, IPC_CREAT | IPC_EXCL | 0700);
- if(buf->shmid == -1) {
+ if(result == -1 && errno == EINVAL) {
+ ERR("shmget() returned EINVAL; maybe /proc/sys/kernel/shmmax should be increased.");
+ return -1;
+ }
+ else if(result == -1) {
PERROR("shmget");
return -1;
}
result = send(conn->fd, req, strlen(req), MSG_NOSIGNAL);
if(result == -1) {
- if(errno != ECONNRESET)
+ if(errno != EPIPE)
PERROR("send");
return -1;
}
handle->server.listen_fd = init_named_socket(name, &(handle->server.socketpath));
if(handle->server.listen_fd < 0) {
- ERR("error initializing named socket");
+ ERR("Error initializing named socket (%s). Check that directory exists and that it is writable.", name);
goto free_name;
}
free(name);
retval = -1;
goto end;
}
- else if(result == 0) {
- DBG("app died while being traced");
- retval = GET_SUBBUF_DIED;
- goto end;
- }
result = sscanf(received_msg, "%as %ld", &rep_code, &buf->consumed_old);
if(result != 2 && result != 1) {