Skip to content

Commit

Permalink
Include the perror string when reporting a failure to open the shared…
Browse files Browse the repository at this point in the history
… memory file. Comments.

BUGZID:
  • Loading branch information
lehenbauer committed Apr 17, 2013
1 parent 8eb1902 commit 4c8f3cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ctables/shared/shared.c
Expand Up @@ -103,6 +103,14 @@ char *shared_errmsg[] = {
NULL
};

// shared_perror - emit an error message to sderr
//
// if shared_errno is negative, makes it positive and uses it as an index
// into shared_errmsg above for the message
//
// if shared_errno is positive, uses the shared_errmsg above and also
// includes the posix error string.
//
void shared_perror(char *text) {
static char bigbuf [1024];
if(shared_errno < 0) {
Expand Down Expand Up @@ -261,7 +269,7 @@ IFDEBUG(init_debug();)
if(fd == -1) {
// No file, and not creator, can't recover
if(!create) {
shared_errno = -SH_NO_MAP;
shared_errno = SH_NO_MAP;
return 0;
}

Expand Down

0 comments on commit 4c8f3cc

Please sign in to comment.