mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
replace: Support setproctitle().
This uses the setproctitle() from libc, libsetproctitle or libbsd. If none is available it provides a dummy implementation.
This commit is contained in:
@ -73,6 +73,7 @@ readlink
|
|||||||
symlink
|
symlink
|
||||||
realpath
|
realpath
|
||||||
poll
|
poll
|
||||||
|
setproctitle
|
||||||
|
|
||||||
Types:
|
Types:
|
||||||
bool
|
bool
|
||||||
|
@ -894,3 +894,10 @@ int rep_usleep(useconds_t sec)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_USLEEP */
|
#endif /* HAVE_USLEEP */
|
||||||
|
|
||||||
|
#ifndef HAVE_SETPROCTITLE
|
||||||
|
void rep_setproctitle(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -128,6 +128,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SETPROCTITLE_H
|
||||||
|
#include <setproctitle.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if STDC_HEADERS
|
#if STDC_HEADERS
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@ -845,4 +849,9 @@ typedef long useconds_t;
|
|||||||
int usleep(useconds_t);
|
int usleep(useconds_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_SETPROCTITLE
|
||||||
|
#define setproctitle rep_setproctitle
|
||||||
|
void rep_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _LIBREPLACE_REPLACE_H */
|
#endif /* _LIBREPLACE_REPLACE_H */
|
||||||
|
@ -193,6 +193,8 @@ struct foo bar = { .y = 'X', .x = 1 };
|
|||||||
checklibc=True)
|
checklibc=True)
|
||||||
if not conf.CHECK_FUNCS('getpeereid'):
|
if not conf.CHECK_FUNCS('getpeereid'):
|
||||||
conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
|
conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
|
||||||
|
if not conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h'):
|
||||||
|
conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h')
|
||||||
|
|
||||||
conf.CHECK_CODE('''
|
conf.CHECK_CODE('''
|
||||||
struct ucred cred;
|
struct ucred cred;
|
||||||
|
@ -395,8 +395,8 @@ class cmd_domain_provision(Command):
|
|||||||
serverrole=server_role, dom_for_fun_level=dom_for_fun_level,
|
serverrole=server_role, dom_for_fun_level=dom_for_fun_level,
|
||||||
backend_type=ldap_backend_type,
|
backend_type=ldap_backend_type,
|
||||||
ldapadminpass=ldapadminpass, ol_mmr_urls=ol_mmr_urls,
|
ldapadminpass=ldapadminpass, ol_mmr_urls=ol_mmr_urls,
|
||||||
useeadb=eadb, next_rid=next_rid, lp=lp, use_ntvfs=(use_ntvfs),
|
useeadb=eadb, next_rid=next_rid, lp=lp, use_ntvfs=use_ntvfs,
|
||||||
use_rfc2307=(use_rfc2307))
|
use_rfc2307=use_rfc2307)
|
||||||
except ProvisioningError, e:
|
except ProvisioningError, e:
|
||||||
raise CommandError("Provision failed", e)
|
raise CommandError("Provision failed", e)
|
||||||
|
|
||||||
|
@ -32,19 +32,6 @@
|
|||||||
#include "param/param.h"
|
#include "param/param.h"
|
||||||
#include "ldb_wrap.h"
|
#include "ldb_wrap.h"
|
||||||
|
|
||||||
#ifdef HAVE_SETPROCTITLE
|
|
||||||
#ifdef HAVE_SETPROCTITLE_H
|
|
||||||
#include <setproctitle.h>
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define setproctitle none_setproctitle
|
|
||||||
static int none_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
|
|
||||||
static int none_setproctitle(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NTSTATUS process_model_onefork_init(void);
|
NTSTATUS process_model_onefork_init(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user