aboutsummaryrefslogtreecommitdiff
path: root/src/piesctl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-03-19 08:59:02 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-03-19 08:59:02 +0200
commit238924457849e53eae3771bc6240883b37e1ff34 (patch)
treed3be17fde8c3f8e919b8d7e5ea72f34805926386 /src/piesctl.c
parentc95307bfe28691d00f8ad394dec1966f0bf14e32 (diff)
downloadpies-238924457849e53eae3771bc6240883b37e1ff34.tar.gz
pies-238924457849e53eae3771bc6240883b37e1ff34.tar.bz2
Fix some compilation issues on Solaris
* configure.ac: Check for libnsl * src/pies.c (string_to_syslog_facility): LOG_AUTHPRIV and LOG_FTP may be undefined. * src/piesctl.c (EX_NOTFOUND): Rename to EX_PIES_NOTFOUND. (com_list): Use default_cond. * src/sysvinit.c (console_stty): Make sure CBAUDEX is defined. * src/utmp.c (fill_utmp): Declare locals right before using them.
Diffstat (limited to 'src/piesctl.c')
-rw-r--r--src/piesctl.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/piesctl.c b/src/piesctl.c
index d10bd0e..71efbcd 100644
--- a/src/piesctl.c
+++ b/src/piesctl.c
@@ -54,8 +54,8 @@ int dump;
struct grecs_sockaddr_hints hints = { .flags = GRECS_AH_PASSIVE };
-#define EX_OK 0
-#define EX_NOTFOUND 1
+#define EX_OK 0
+#define EX_PIES_NOTFOUND 1
int exit_status = EX_OK;
@@ -1006,7 +1006,7 @@ shttp_process (struct shttp_connection *conn, int method, char const *uri)
case 404: /* Not found */
case 409: /* Conflict */
- exit_status = EX_NOTFOUND;
+ exit_status = EX_PIES_NOTFOUND;
shttp_print_error (conn);
return;
@@ -1484,11 +1484,24 @@ parse_condition_to_uri (char const *base, struct cmdline_parser_state *state,
return ret;
}
+/* Provide default condition if there are no more arguments */
+static struct cmdline_parser_state *
+default_cond (struct cmdline_parser_state *state)
+{
+ if (!peek_token (state))
+ {
+ static char *dfl[] = { "type", "component", NULL };
+ state->argc = sizeof (dfl) / sizeof (dfl[0]);
+ state->argv = dfl;
+ }
+ return state;
+}
+
static void
com_list (struct cmdline_parser_state *state)
{
struct shttp_connection *conn = state->conn;
- char *uri = parse_condition_to_uri ("/programs", state, 0);
+ char *uri = parse_condition_to_uri ("/programs", default_cond (state), 0);
shttp_io_init (&conn->req);
shttp_process (conn, METH_GET, uri);
@@ -1583,19 +1596,6 @@ shttp_print_response_status (struct shttp_connection *conn)
}
}
-/* Provide default condition if there are no more arguments */
-static struct cmdline_parser_state *
-default_cond (struct cmdline_parser_state *state)
-{
- if (!peek_token (state))
- {
- static char *dfl[] = { "type", "component", NULL };
- state->argc = sizeof (dfl) / sizeof (dfl[0]);
- state->argv = dfl;
- }
- return state;
-}
-
static void
com_stop (struct cmdline_parser_state *state)
{

Return to:

Send suggestions and report system problems to the System administrator.