summaryrefslogtreecommitdiffstats
path: root/sesman/tools
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/tools')
-rw-r--r--sesman/tools/dis.c7
-rw-r--r--sesman/tools/sesadmin.c16
-rw-r--r--sesman/tools/sesrun.c3
-rw-r--r--sesman/tools/sestest.c3
4 files changed, 23 insertions, 6 deletions
diff --git a/sesman/tools/dis.c b/sesman/tools/dis.c
index adcc3ee0..a21fbac4 100644
--- a/sesman/tools/dis.c
+++ b/sesman/tools/dis.c
@@ -58,7 +58,12 @@ int main(int argc, char **argv)
return 1;
}
- sck = socket(PF_UNIX, SOCK_DGRAM, 0);
+ if ((sck = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0)
+ {
+ printf("socket open error\n");
+ return 1;
+ }
+
len = sizeof(sa);
if (sendto(sck, "sig", 4, 0, (struct sockaddr *)&sa, len) > 0)
diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c
index 25af850b..32789c6d 100644
--- a/sesman/tools/sesadmin.c
+++ b/sesman/tools/sesadmin.c
@@ -107,6 +107,12 @@ int main(int argc, char **argv)
scp_init(&logging);
sock = g_tcp_socket();
+ if (sock < 0)
+ {
+ LOG_DBG("Socket open error, g_tcp_socket() failed\n");
+ return 1;
+ }
+
s = scp_session_create();
c = scp_connection_create(sock);
@@ -179,16 +185,16 @@ void cmndList(struct SCP_CONNECTION *c)
(dsl[idx]).idle_days, (dsl[idx]).idle_hours, (dsl[idx]).idle_minutes, \
(dsl[idx]).conn_year, (dsl[idx]).conn_month, (dsl[idx]).conn_day, (dsl[idx]).conn_hour, (dsl[idx]).conn_minute);
}
-
- if (0 != dsl)
- {
- g_free(dsl);
- }
}
else
{
printf("No sessions.\n");
}
+
+ if (0 != dsl)
+ {
+ g_free(dsl);
+ }
}
void cmndKill(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
diff --git a/sesman/tools/sesrun.c b/sesman/tools/sesrun.c
index 7ac10102..a9181583 100644
--- a/sesman/tools/sesrun.c
+++ b/sesman/tools/sesrun.c
@@ -75,7 +75,10 @@ main(int argc, char **argv)
init_stream(in_s, 8192);
make_stream(out_s);
init_stream(out_s, 8192);
+
sck = g_tcp_socket();
+ if (sck < 0)
+ return 1;
if (g_tcp_connect(sck, argv[1], g_cfg.listen_port) == 0)
{
diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c
index f2823eb6..d42b31de 100644
--- a/sesman/tools/sestest.c
+++ b/sesman/tools/sestest.c
@@ -38,6 +38,9 @@ int main(int argc, char **argv)
scp_init(&log);
sock = g_tcp_socket();
+ if (sock < 0)
+ return 1;
+
s = scp_session_create();
c = scp_connection_create(sock);