| OLD | NEW |
| 1 diff --git a/compat/Makefile.am b/compat/Makefile.am | 1 diff --git a/compat/Makefile.am b/compat/Makefile.am |
| 2 --- a/compat/Makefile.am | 2 --- a/compat/Makefile.am |
| 3 +++ b/compat/Makefile.am | 3 +++ b/compat/Makefile.am |
| 4 @@ -1,8 +1,7 @@ | 4 @@ -1,8 +1,7 @@ |
| 5 -noinst_LTLIBRARIES= libbsd_compat.la | 5 -noinst_LTLIBRARIES= libbsd_compat.la |
| 6 noinst_HEADERS= bsd_compat.h endian_util.h \ | 6 noinst_HEADERS= bsd_compat.h endian_util.h \ |
| 7 humanize_number.h | 7 humanize_number.h |
| 8 | 8 |
| 9 -libbsd_compat_la_SOURCES= basename.c \ | 9 -libbsd_compat_la_SOURCES= basename.c \ |
| 10 +sources= basename.c \ | 10 +sources= basename.c \ |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 exit(EX_OK); | 1910 exit(EX_OK); |
| 1911 | 1911 |
| 1912 printf("%s\n", pkg_config_dump()); | 1912 printf("%s\n", pkg_config_dump()); |
| 1913 - show_plugin_info(); | 1913 - show_plugin_info(); |
| 1914 +#ifndef _NEWLIB_VERSION | 1914 +#ifndef _NEWLIB_VERSION |
| 1915 + show_plugin_info(); | 1915 + show_plugin_info(); |
| 1916 +#endif | 1916 +#endif |
| 1917 show_repository_info(); | 1917 show_repository_info(); |
| 1918 | 1918 |
| 1919 exit(EX_OK); | 1919 exit(EX_OK); |
| 1920 @@ -438,9 +452,12 @@ export_arg_option (char *arg) | 1920 @@ -438,6 +452,8 @@ export_arg_option (char *arg) |
| 1921 } | 1921 } |
| 1922 } | 1922 } |
| 1923 | 1923 |
| 1924 +#ifndef __native_client__ | 1924 +#ifndef __native_client__ |
| 1925 +/* The use of fork here is not compatible with NaCl, which only has vfork() */ | 1925 +/* The use of fork here is not compatible with NaCl, which only has vfork() */ |
| 1926 static void | 1926 static void |
| 1927 start_process_worker(char *const *save_argv) | 1927 start_process_worker(char *const *save_argv) |
| 1928 { | 1928 { |
| 1929 + fprintf(stderr, "start_process_worker %s %s\n", getprogname(), save_argv[0]); | 1929 @@ -463,7 +479,7 @@ start_process_worker(char *const *save_argv) |
| 1930 » int» ret = EX_OK; | |
| 1931 » int» status; | |
| 1932 » pid_t» child_pid; | |
| 1933 @@ -463,7 +480,7 @@ start_process_worker(char *const *save_argv) | |
| 1934 } else { | 1930 } else { |
| 1935 if (child_pid == -1) | 1931 if (child_pid == -1) |
| 1936 err(EX_OSERR, "Failed to fork worker process"); | 1932 err(EX_OSERR, "Failed to fork worker process"); |
| 1937 - | 1933 - |
| 1938 + | 1934 + |
| 1939 while (waitpid(child_pid, &status, 0) == -1) { | 1935 while (waitpid(child_pid, &status, 0) == -1) { |
| 1940 if (errno != EINTR) | 1936 if (errno != EINTR) |
| 1941 err(EX_OSERR, "Child process pid=%d", (i
nt)child_pid); | 1937 err(EX_OSERR, "Child process pid=%d", (i
nt)child_pid); |
| 1942 @@ -486,6 +503,7 @@ start_process_worker(char *const *save_argv) | 1938 @@ -486,6 +502,7 @@ start_process_worker(char *const *save_argv) |
| 1943 exit(ret); | 1939 exit(ret); |
| 1944 /* NOTREACHED */ | 1940 /* NOTREACHED */ |
| 1945 } | 1941 } |
| 1946 +#endif | 1942 +#endif |
| 1947 | 1943 |
| 1948 static int | 1944 static int |
| 1949 expand_aliases(int argc, char ***argv) | 1945 expand_aliases(int argc, char ***argv) |
| 1950 @@ -580,7 +598,9 @@ main(int argc, char **argv) | 1946 @@ -580,7 +597,9 @@ main(int argc, char **argv) |
| 1951 #ifdef HAVE_LIBJAIL | 1947 #ifdef HAVE_LIBJAIL |
| 1952 { "jail", required_argument, NULL, 'j' }, | 1948 { "jail", required_argument, NULL, 'j' }, |
| 1953 #endif | 1949 #endif |
| 1954 +#ifndef _NEWLIB_VERSION | 1950 +#ifndef _NEWLIB_VERSION |
| 1955 { "chroot", required_argument, NULL, 'c' }, | 1951 { "chroot", required_argument, NULL, 'c' }, |
| 1956 +#endif | 1952 +#endif |
| 1957 { "config", required_argument, NULL, 'C' }, | 1953 { "config", required_argument, NULL, 'C' }, |
| 1958 { "repo-conf-dir", required_argument, NULL, 'R' }, | 1954 { "repo-conf-dir", required_argument, NULL, 'R' }, |
| 1959 { "rootdir", required_argument, NULL, 'r' }, | 1955 { "rootdir", required_argument, NULL, 'r' }, |
| 1960 @@ -622,9 +642,11 @@ main(int argc, char **argv) | 1956 @@ -622,9 +641,11 @@ main(int argc, char **argv) |
| 1961 case 'd': | 1957 case 'd': |
| 1962 debug++; | 1958 debug++; |
| 1963 break; | 1959 break; |
| 1964 +#ifndef _NEWLIB_VERSION | 1960 +#ifndef _NEWLIB_VERSION |
| 1965 case 'c': | 1961 case 'c': |
| 1966 chroot_path = optarg; | 1962 chroot_path = optarg; |
| 1967 break; | 1963 break; |
| 1968 +#endif | 1964 +#endif |
| 1969 case 'C': | 1965 case 'C': |
| 1970 conffile = optarg; | 1966 conffile = optarg; |
| 1971 break; | 1967 break; |
| 1972 @@ -684,8 +706,10 @@ main(int argc, char **argv) | 1968 @@ -684,8 +705,10 @@ main(int argc, char **argv) |
| 1973 optreset = 1; | 1969 optreset = 1; |
| 1974 optind = 1; | 1970 optind = 1; |
| 1975 | 1971 |
| 1976 +#ifndef __native_client__ | 1972 +#ifndef __native_client__ |
| 1977 if (debug == 0 && version == 0) | 1973 if (debug == 0 && version == 0) |
| 1978 start_process_worker(save_argv); | 1974 start_process_worker(save_argv); |
| 1979 +#endif | 1975 +#endif |
| 1980 | 1976 |
| 1981 #ifdef HAVE_ARC4RANDOM | 1977 #ifdef HAVE_ARC4RANDOM |
| 1982 /* Ensure that random is stirred after a possible fork */ | 1978 /* Ensure that random is stirred after a possible fork */ |
| 1983 @@ -699,11 +723,13 @@ main(int argc, char **argv) | 1979 @@ -699,11 +722,13 @@ main(int argc, char **argv) |
| 1984 "-j, -c and/or -r cannot be used at the same time!\n"); | 1980 "-j, -c and/or -r cannot be used at the same time!\n"); |
| 1985 } | 1981 } |
| 1986 | 1982 |
| 1987 +#ifndef _NEWLIB_VERSION | 1983 +#ifndef _NEWLIB_VERSION |
| 1988 if (chroot_path != NULL) { | 1984 if (chroot_path != NULL) { |
| 1989 if (chroot(chroot_path) == -1) { | 1985 if (chroot(chroot_path) == -1) { |
| 1990 err(EX_SOFTWARE, "chroot failed"); | 1986 err(EX_SOFTWARE, "chroot failed"); |
| 1991 } | 1987 } |
| 1992 } | 1988 } |
| 1993 +#endif | 1989 +#endif |
| 1994 | 1990 |
| 1995 #ifdef HAVE_LIBJAIL | 1991 #ifdef HAVE_LIBJAIL |
| 1996 if (jail_str != NULL) { | 1992 if (jail_str != NULL) { |
| 1997 @@ -729,9 +755,6 @@ main(int argc, char **argv) | 1993 @@ -729,9 +754,6 @@ main(int argc, char **argv) |
| 1998 if (pkg_ini(conffile, reposdir, init_flags) != EPKG_OK) | 1994 if (pkg_ini(conffile, reposdir, init_flags) != EPKG_OK) |
| 1999 errx(EX_SOFTWARE, "Cannot parse configuration file!"); | 1995 errx(EX_SOFTWARE, "Cannot parse configuration file!"); |
| 2000 | 1996 |
| 2001 - if (debug > 0) | 1997 - if (debug > 0) |
| 2002 - pkg_set_debug_level(debug); | 1998 - pkg_set_debug_level(debug); |
| 2003 - | 1999 - |
| 2004 if (atexit(&pkg_shutdown) != 0) | 2000 if (atexit(&pkg_shutdown) != 0) |
| 2005 errx(EX_SOFTWARE, "register pkg_shutdown() to run at exit"); | 2001 errx(EX_SOFTWARE, "register pkg_shutdown() to run at exit"); |
| 2006 | 2002 |
| 2007 @@ -742,6 +765,7 @@ main(int argc, char **argv) | 2003 @@ -742,6 +764,7 @@ main(int argc, char **argv) |
| 2008 | 2004 |
| 2009 plugins_enabled = pkg_object_bool(pkg_config_get("PKG_ENABLE_PLUGINS")); | 2005 plugins_enabled = pkg_object_bool(pkg_config_get("PKG_ENABLE_PLUGINS")); |
| 2010 | 2006 |
| 2011 +#ifndef _NEWLIB_VERSION | 2007 +#ifndef _NEWLIB_VERSION |
| 2012 if (plugins_enabled) { | 2008 if (plugins_enabled) { |
| 2013 struct pkg_plugin *p = NULL; | 2009 struct pkg_plugin *p = NULL; |
| 2014 | 2010 |
| 2015 @@ -768,6 +792,7 @@ main(int argc, char **argv) | 2011 @@ -768,6 +791,7 @@ main(int argc, char **argv) |
| 2016 } | 2012 } |
| 2017 } | 2013 } |
| 2018 } | 2014 } |
| 2019 +#endif | 2015 +#endif |
| 2020 | 2016 |
| 2021 if (version > 1) | 2017 if (version > 1) |
| 2022 show_version_info(version); | 2018 show_version_info(version); |
| 2023 diff --git a/src/pkgcli.h b/src/pkgcli.h | 2019 diff --git a/src/pkgcli.h b/src/pkgcli.h |
| 2024 --- a/src/pkgcli.h | 2020 --- a/src/pkgcli.h |
| 2025 +++ b/src/pkgcli.h | 2021 +++ b/src/pkgcli.h |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2156 | 2152 |
| 2157 +if DYNAMIC | 2153 +if DYNAMIC |
| 2158 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil | 2154 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil |
| 2159 +else | 2155 +else |
| 2160 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la | 2156 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la |
| 2161 +endif | 2157 +endif |
| 2162 + | 2158 + |
| 2163 if HAVE_ELF_ABI | 2159 if HAVE_ELF_ABI |
| 2164 if LIBELF_BUNDLED | 2160 if LIBELF_BUNDLED |
| 2165 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la | 2161 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la |
| OLD | NEW |