Package: softflowd / 0.9.9-5

cherry-pick.softflowd-0.9.9-2-gcdf7ae1.using-strtok-instead-of-strsep-in-environments-which-does-not-have-strsep.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Subject: Using strtok instead of strsep in environments which does not have strsep
Origin: softflowd-0.9.9-2-gcdf7ae1 <https://github.com/irino/softflowd/commit/softflowd-0.9.9-2-gcdf7ae1>
Upstream-Author: Hitoshi Irino <hitoshi.irino@gmail.com>
Date: Sun Sep 23 03:43:48 2012 +0900

--- a/configure.ac
+++ b/configure.ac
@@ -87,7 +87,7 @@
 AC_SEARCH_LIBS(socket, socket)
 AC_CHECK_LIB(pcap, pcap_open_live)
 
-AC_CHECK_FUNCS(closefrom daemon setresuid setreuid setresgid setgid strlcpy strlcat)
+AC_CHECK_FUNCS(closefrom daemon setresuid setreuid setresgid setgid strlcpy strlcat strsep)
 
 AC_CHECK_TYPES([u_int64_t, int64_t, uint64_t, u_int32_t, int32_t, uint32_t])
 AC_CHECK_TYPES([u_int16_t, int16_t, uint16_t, u_int8_t, int8_t, uint8_t])
--- a/softflowd.c
+++ b/softflowd.c
@@ -1736,7 +1736,11 @@
 				usage();
 				exit(1);
 			}
+#if defined(HAVE_STRSEP)
 			dev = strsep(&optarg, ":");
+#else /* defined(HAVE_STRSEP) */
+			dev = strtok(optarg, ":");
+#endif /* defined(HAVE_STRSEP) */
 			if (optarg != NULL) {
 				if_index = (u_int16_t) atoi(dev);
 				dev = optarg;