mirror of
https://github.com/uselessd/alcove.git
synced 2026-04-15 01:04:41 +00:00
Fix compilation errors on Solaris
Use POSIX 200112L/C99 mode on Solaris to suppress compilation warnings. "-D__EXTENSIONS__=1" is required for NSIG (max number of signals). This also pulls in an ERR macro which necessitates renaming the goto label from ERR -> ERROR.
This commit is contained in:
@@ -59,7 +59,7 @@ alcove_sys_open(alcove_state_t *ap, const char *arg, size_t len,
|
||||
fd = open(pathname, flags, mode);
|
||||
|
||||
if (fd < 0)
|
||||
goto ERR;
|
||||
goto ERROR;
|
||||
|
||||
ALCOVE_OK(
|
||||
reply,
|
||||
@@ -69,7 +69,7 @@ alcove_sys_open(alcove_state_t *ap, const char *arg, size_t len,
|
||||
|
||||
return rindex;
|
||||
|
||||
ERR:
|
||||
ERROR:
|
||||
errnum = errno;
|
||||
(void)close(fd);
|
||||
return alcove_mk_errno(reply, rlen, errnum);
|
||||
|
||||
@@ -162,13 +162,13 @@ alcove_sys_clone(alcove_state_t *ap, const char *arg, size_t len,
|
||||
return alcove_mk_errno(reply, rlen, errno);
|
||||
|
||||
if (alcove_stdio(&fd) < 0)
|
||||
goto ERR;
|
||||
goto ERROR;
|
||||
|
||||
(void)sigfillset(&set);
|
||||
(void)sigemptyset(&oldset);
|
||||
|
||||
if (sigprocmask(SIG_BLOCK, &set, &oldset) < 0)
|
||||
goto ERR;
|
||||
goto ERROR;
|
||||
|
||||
child_arg.ap = ap;
|
||||
child_arg.fd = &fd;
|
||||
@@ -178,10 +178,10 @@ alcove_sys_clone(alcove_state_t *ap, const char *arg, size_t len,
|
||||
flags | SIGCHLD, &child_arg);
|
||||
|
||||
if (sigprocmask(SIG_SETMASK, &oldset, NULL) < 0)
|
||||
goto ERR;
|
||||
goto ERROR;
|
||||
|
||||
if (pid < 0)
|
||||
goto ERR;
|
||||
goto ERROR;
|
||||
|
||||
free(child_stack);
|
||||
|
||||
@@ -194,7 +194,7 @@ alcove_sys_clone(alcove_state_t *ap, const char *arg, size_t len,
|
||||
|
||||
return rindex;
|
||||
|
||||
ERR:
|
||||
ERROR:
|
||||
errnum = errno;
|
||||
free(child_stack);
|
||||
return alcove_mk_errno(reply, rlen, errnum);
|
||||
|
||||
@@ -427,17 +427,17 @@ alcove_decode_list_to_argv(const char *arg, size_t len, int *index,
|
||||
for (i = 0; i < arity; i++) {
|
||||
(*argv)[i] = alcove_x_decode_iolist_to_string(arg, len, index);
|
||||
if (!(*argv)[i])
|
||||
goto ERR;
|
||||
goto BADARG;
|
||||
}
|
||||
|
||||
/* list tail */
|
||||
if (arity > 0 && (alcove_decode_list_header(arg, len, index, &empty) < 0
|
||||
|| empty != 0))
|
||||
goto ERR;
|
||||
goto BADARG;
|
||||
|
||||
return 0;
|
||||
|
||||
ERR:
|
||||
BADARG:
|
||||
alcove_free_argv(*argv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{port_env, [
|
||||
{"EXE_LDFLAGS", "$ALCOVE_LDFLAGS $EXE_LDFLAGS"},
|
||||
{"solaris", "EXE_LDFLAGS", "$ALCOVE_LDFLAGS -lsocket -lnsl $EXE_LDFLAGS"},
|
||||
{"solaris", "CFLAGS", "-std=c99 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__=1"},
|
||||
{"EXE_CFLAGS", "$EXE_CFLAGS $ALCOVE_CFLAGS"}
|
||||
]}.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user