summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsource/configure2
-rw-r--r--source/configure.in2
-rw-r--r--source/include/config.h.in3
-rw-r--r--source/printing/print_svid.c4
-rw-r--r--source/smbd/dfree.c2
5 files changed, 11 insertions, 2 deletions
diff --git a/source/configure b/source/configure
index 97366dbdef7..fd6902bf2e9 100755
--- a/source/configure
+++ b/source/configure
@@ -4203,7 +4203,7 @@ else
fi
done
-for ac_func in initgroups select rdchk getgrnam getgrent pathconf
+for ac_func in initgroups select rdchk getgrnam getgrent pathconf popen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4210: checking for $ac_func" >&5
diff --git a/source/configure.in b/source/configure.in
index d3e87c516ec..4f78de7df70 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -352,7 +352,7 @@ AC_CHECK_FUNCS(waitpid getcwd strdup strtoul strerror chown chmod chroot)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset)
AC_CHECK_FUNCS(memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid)
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent)
-AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf)
+AC_CHECK_FUNCS(initgroups select rdchk getgrnam getgrent pathconf popen)
AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups mktime rename ftruncate stat64 fstat64)
AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid yp_get_default_domain getpwanam)
diff --git a/source/include/config.h.in b/source/include/config.h.in
index 732798ac248..49344a05c8a 100644
--- a/source/include/config.h.in
+++ b/source/include/config.h.in
@@ -547,6 +547,9 @@
/* Define if you have the pipe function. */
#undef HAVE_PIPE
+/* Define if you have the popen function. */
+#undef HAVE_POPEN
+
/* Define if you have the pread function. */
#undef HAVE_PREAD
diff --git a/source/printing/print_svid.c b/source/printing/print_svid.c
index 85eaf8f95dd..ffc059f9f91 100644
--- a/source/printing/print_svid.c
+++ b/source/printing/print_svid.c
@@ -47,6 +47,7 @@ static printer_t *printers = NULL;
static void populate_printers(void)
{
+#ifdef HAVE_POPEN
FILE *fp;
if ((fp = popen("/usr/bin/lpstat -v", "r")) != NULL) {
@@ -91,6 +92,9 @@ static void populate_printers(void)
} else {
DEBUG(0,( "Unable to run lpstat!\n"));
}
+#else
+ DEBUG(0,( "No popen() defined: Unable to run lpstat!\n"));
+#endif
}
diff --git a/source/smbd/dfree.c b/source/smbd/dfree.c
index bd06d3f2351..78380804615 100644
--- a/source/smbd/dfree.c
+++ b/source/smbd/dfree.c
@@ -208,6 +208,7 @@ static SMB_BIG_UINT disk_free(char *path, BOOL small_query,
* If external disk calculation specified, use it.
*/
+#ifdef HAVE_POPEN
dfree_command = lp_dfree_command();
if (dfree_command && *dfree_command) {
pstring line;
@@ -249,6 +250,7 @@ static SMB_BIG_UINT disk_free(char *path, BOOL small_query,
fsusage(path, dfree, dsize);
}
} else
+#endif /* HAVE_POPEN */
fsusage(path, dfree, dsize);
if (disk_quotas(path, &bsize_q, &dfree_q, &dsize_q)) {