summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-07-19 16:41:07 -0700
committerJeremy Allison <jra@samba.org>2012-07-20 03:57:20 +0200
commitb336b8ed586e7058e24332339241ffd31ccb1b68 (patch)
treeb6732ae65e512682abd3997c0326fb8f30d2c836
parente8dbf2889f0f5c6d213e92cbfd97b6a874aedb03 (diff)
downloadsamba-b336b8ed586e7058e24332339241ffd31ccb1b68.tar.gz
samba-b336b8ed586e7058e24332339241ffd31ccb1b68.tar.bz2
samba-b336b8ed586e7058e24332339241ffd31ccb1b68.zip
Remove source3/lib/pidfile.c
Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 20 03:57:20 CEST 2012 on sn-devel-104
-rw-r--r--source3/Makefile.in9
-rw-r--r--source3/include/proto.h6
-rw-r--r--source3/lib/pidfile.c81
-rwxr-xr-xsource3/wscript_build6
4 files changed, 1 insertions, 101 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 80122f8c97..4fc3efd208 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -460,7 +460,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \
$(VERSION_OBJ) lib/charcnv.o ../lib/util/charset/convert_string.o \
../lib/util/charset/pull_push.o \
lib/fstring.o ../lib/util/debug.o ../lib/util/debug_s3.o ../lib/util/fault.o \
- lib/interface.o lib/pidfile.o lib/dumpcore.o \
+ lib/interface.o lib/dumpcore.o \
lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
lib/username.o \
../libds/common/flag_mapping.o \
@@ -1864,13 +1864,6 @@ libsmb/libsmb_thread_posix.o: libsmb/libsmb_thread_posix.c
$(COMPILE_CC) $(PTHREAD_CFLAGS) >/dev/null 2>&1
### End section of object files that require PTHREAD_CFLAGS
-lib/pidfile.o: lib/pidfile.c
- @echo Compiling $*.c
- @$(COMPILE_CC_PATH) && exit 0;\
- echo "The following command failed:" 1>&2;\
- echo "$(COMPILE_CC_PATH)" 1>&2;\
- $(COMPILE_CC_PATH) >/dev/null 2>&1
-
lib/version.o: lib/version.c include/autoconf/version.h
@echo Compiling $*.c
@$(COMPILE_CC_PATH) && exit 0;\
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ede06bd6ce..585067eccc 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -158,12 +158,6 @@ char *escape_rdn_val_string_alloc(const char *s);
int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
bool is_case_sensitive);
-/* The following definitions come from lib/pidfile.c */
-
-pid_t pidfile_pid_s3(const char *name);
-void pidfile_create_s3(const char *program_name);
-void pidfile_unlink_s3(const char *program_name);
-
/* The following definitions come from lib/recvfile.c */
ssize_t sys_recvfile(int fromfd,
diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c
deleted file mode 100644
index 79ea3a5330..0000000000
--- a/source3/lib/pidfile.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* this code is broken - there is a race condition with the unlink (tridge) */
-
-/*
- Unix SMB/CIFS implementation.
- pidfile handling
- Copyright (C) Andrew Tridgell 1998
- Copyright (C) Jeremy Allison 2012
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "system/filesys.h"
-#include "../lib/util/pidfile.h"
-
-/* Malloc a pidfile name. */
-static char *get_pidfile_name(const char *program_name)
-{
- char *name = NULL;
-
- /* Add a suffix to the program name if this is a process with a
- * none default configuration file name. */
- if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) {
- name = SMB_STRDUP(program_name);
- } else {
- const char *short_configfile;
- short_configfile = strrchr( get_dyn_CONFIGFILE(), '/');
- if (short_configfile == NULL) {
- /* conf file in current directory */
- short_configfile = get_dyn_CONFIGFILE();
- } else {
- /* full/relative path provided */
- short_configfile++;
- }
- if (asprintf(&name, "%s-%s", program_name,
- short_configfile) == -1) {
- smb_panic("asprintf failed");
- }
- }
- return name;
-}
-
-/* return the pid in a pidfile. return 0 if the process (or pidfile)
- does not exist */
-pid_t pidfile_pid_s3(const char *program_name)
-{
- pid_t pid = 0;
- char *name = get_pidfile_name(program_name);
-
- pid = pidfile_pid(lp_piddir(), name);
- SAFE_FREE(name);
- return pid;
-}
-
-/* create a pid file in the pid directory. open it and leave it locked */
-void pidfile_create_s3(const char *program_name)
-{
- char *name = get_pidfile_name(program_name);
-
- pidfile_create(lp_piddir(), name);
- SAFE_FREE(name);
-}
-
-/* Remove a pidfile. */
-void pidfile_unlink_s3(const char *program_name)
-{
- char *name = get_pidfile_name(program_name);
- pidfile_unlink(lp_piddir(), name);
- SAFE_FREE(name);
-}
diff --git a/source3/wscript_build b/source3/wscript_build
index 7204220b0a..bed31a15ff 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -785,15 +785,9 @@ bld.SAMBA3_SUBSYSTEM('samba3util',
deps='ndr security NDR_SECURITY samba-util util_tdb ccan-hash',
vars=locals())
-bld.SAMBA3_SUBSYSTEM('pidfile',
- source='lib/pidfile.c',
- # only pidfile.c assumes that CONFIGFILE is set
- cflags = ['-DCONFIGFILE="%s"' % bld.env['CONFIGFILE']])
-
bld.SAMBA3_SUBSYSTEM('samba3core',
source=LIB_SRC,
deps='''
- pidfile
samba3util
LIBTSOCKET
NDR_MESSAGING