Make it compile on FreeBSD.
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index bef35425b9fd873bd652ee92ed2462738d1d158c..b7d27927c3aa491866d1ed89b4ae347d067f6173 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -6,6 +6,7 @@
 
 /** \file afs.c Paraslash's audio file selector. */
 
+#include <signal.h>
 #include <fnmatch.h>
 #include "server.cmdline.h"
 #include "para.h"
@@ -337,40 +338,6 @@ int string_compare(const struct osl_object *obj1, const struct osl_object *obj2)
        return strncmp(str1, str2, PARA_MIN(obj1->size, obj2->size));
 }
 
-/**
- * A wrapper for strtol(3).
- *
- * \param str The string to be converted to a long integer.
- * \param result The converted value is stored here.
- *
- * \return Positive on success, -E_ATOL on errors.
- *
- * \sa strtol(3), atoi(3).
- */
-int para_atol(const char *str, long *result)
-{
-       char *endptr;
-       long val;
-       int ret, base = 10;
-
-       errno = 0; /* To distinguish success/failure after call */
-       val = strtol(str, &endptr, base);
-       ret = -E_ATOL;
-       if (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
-               goto out; /* overflow */
-       if (errno != 0 && val == 0)
-               goto out; /* other error */
-       if (endptr == str)
-               goto out; /* No digits were found */
-       if (*endptr != '\0')
-               goto out; /* Further characters after number */
-       *result = val;
-       ret = 1;
-out:
-       return ret;
-}
-
-
 /*
  * write input from fd to dynamically allocated buffer,
  * but maximal max_size byte.