diff options
author | Martin Schwenke <martin@meltin.net> | 2014-09-22 18:14:53 +1000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-10-04 00:11:20 +0200 |
commit | 3d6675fd1ee32ba0795f7f09f42a1b005ba5e621 (patch) | |
tree | 6327cfbc96214079e93ec2f5b5c14f1eee7404d1 | |
parent | 5496270d0f615aa39de0a083ec74fb40a988f64b (diff) | |
download | samba-3d6675fd1ee32ba0795f7f09f42a1b005ba5e621.tar.gz samba-3d6675fd1ee32ba0795f7f09f42a1b005ba5e621.tar.xz samba-3d6675fd1ee32ba0795f7f09f42a1b005ba5e621.zip |
lib/util: Clean up includes for blocking.c
Add blocking.h. Allows standalone compile without external
includes.h.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | lib/util/blocking.c | 3 | ||||
-rw-r--r-- | lib/util/blocking.h | 32 | ||||
-rw-r--r-- | lib/util/samba_util.h | 13 | ||||
-rwxr-xr-x | lib/util/wscript_build | 2 |
4 files changed, 36 insertions, 14 deletions
diff --git a/lib/util/blocking.c b/lib/util/blocking.c index 157804a5be..358eda092a 100644 --- a/lib/util/blocking.c +++ b/lib/util/blocking.c @@ -21,10 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "includes.h" +#include "replace.h" #include "system/network.h" #include "system/filesys.h" #include "system/locale.h" +#include "blocking.h" #undef malloc #undef strcasecmp #undef strncasecmp diff --git a/lib/util/blocking.h b/lib/util/blocking.h new file mode 100644 index 0000000000..017e424060 --- /dev/null +++ b/lib/util/blocking.h @@ -0,0 +1,32 @@ +/* + Unix SMB/CIFS implementation. + Samba utility functions + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Jeremy Allison 2001-2002 + Copyright (C) Simo Sorce 2001 + Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003. + Copyright (C) James J Myers 2003 + + 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/>. +*/ + +#ifndef _SAMBA_BLOCKING_H_ +#define _SAMBA_BLOCKING_H_ + +#include <stdbool.h> + +int set_blocking(int fd, bool set); +bool smb_set_close_on_exec(int fd); + +#endif /* _SAMBA_BLOCKING_H_ */ diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h index e9de6fae22..35eef421af 100644 --- a/lib/util/samba_util.h +++ b/lib/util/samba_util.h @@ -649,18 +649,7 @@ _PUBLIC_ bool directory_create_or_exist_strict(const char *dname, uid_t uid, mode_t dir_perms); -/** - Set a fd into blocking/nonblocking mode. Uses POSIX O_NONBLOCK if available, - else - if SYSV use O_NDELAY - if BSD use FNDELAY -**/ -_PUBLIC_ int set_blocking(int fd, bool set); - -/** - set close on exec on a file descriptor if available - **/ -_PUBLIC_ bool smb_set_close_on_exec(int fd); +#include "blocking.h" /** Sleep for a specified number of milliseconds. diff --git a/lib/util/wscript_build b/lib/util/wscript_build index d7e5b03e62..9bdf8121f7 100755 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -42,7 +42,7 @@ bld.SAMBA_LIBRARY('samba-util', tevent_debug.c util_process.c memcache.c''', deps='DYNCONFIG time-basic close-low-fd samba-debug tini tiniparser socket-blocking', public_deps='talloc tevent execinfo pthread LIBCRYPTO charset util_setid systemd-daemon', - public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h idtree.h idtree_random.h', + public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h idtree.h idtree_random.h blocking.h', header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ], local_include=False, vnum='0.0.1', |