cherry-pick.softflowd-0.9.9-2-gcdf7ae1.using-strtok-instead-of-strsep-in-environments-which-does-not-have-strsep.patch 1.1 KB

123456789101112131415161718192021222324252627282930
  1. Subject: Using strtok instead of strsep in environments which does not have strsep
  2. Origin: softflowd-0.9.9-2-gcdf7ae1 <https://github.com/irino/softflowd/commit/softflowd-0.9.9-2-gcdf7ae1>
  3. Upstream-Author: Hitoshi Irino <hitoshi.irino@gmail.com>
  4. Date: Sun Sep 23 03:43:48 2012 +0900
  5. --- a/configure.ac
  6. +++ b/configure.ac
  7. @@ -87,7 +87,7 @@
  8. AC_SEARCH_LIBS(socket, socket)
  9. AC_CHECK_LIB(pcap, pcap_open_live)
  10. -AC_CHECK_FUNCS(closefrom daemon setresuid setreuid setresgid setgid strlcpy strlcat)
  11. +AC_CHECK_FUNCS(closefrom daemon setresuid setreuid setresgid setgid strlcpy strlcat strsep)
  12. AC_CHECK_TYPES([u_int64_t, int64_t, uint64_t, u_int32_t, int32_t, uint32_t])
  13. AC_CHECK_TYPES([u_int16_t, int16_t, uint16_t, u_int8_t, int8_t, uint8_t])
  14. --- a/softflowd.c
  15. +++ b/softflowd.c
  16. @@ -1736,7 +1736,11 @@
  17. usage();
  18. exit(1);
  19. }
  20. +#if defined(HAVE_STRSEP)
  21. dev = strsep(&optarg, ":");
  22. +#else /* defined(HAVE_STRSEP) */
  23. + dev = strtok(optarg, ":");
  24. +#endif /* defined(HAVE_STRSEP) */
  25. if (optarg != NULL) {
  26. if_index = (u_int16_t) atoi(dev);
  27. dev = optarg;