static GList *
systemd_get_socket (gint number)
{
- int sock, max, flags;
+ int sock, num_passed, flags;
GList *result = NULL;
const gchar *e;
gchar *err;
e = getenv ("LISTEN_FDS");
if (e != NULL) {
errno = 0;
- max = strtoul (e, &err, 10);
- if ((err == NULL || *err == '\0') && max > number) {
+ num_passed = strtoul (e, &err, 10);
+ if ((err == NULL || *err == '\0') && num_passed > number) {
sock = number + sd_listen_fds_start;
if (fstat (sock, &st) == -1) {
return NULL;
}
result = g_list_prepend (result, GINT_TO_POINTER (sock));
}
- else if (max <= number) {
+ else if (num_passed <= number) {
errno = EOVERFLOW;
}
}