summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2011-06-05 21:32:11 +0200
committerBjoern Jacke <bj@sernet.de>2011-06-06 12:58:26 +0200
commit81e48dfa35e1b4df6cf46df74572a2ace81c1b84 (patch)
tree81fe8f84578578d5a7c5c132fd4223987f6c7c20
parent4778d35c34031f7724379ac2d3b554af4adc48dc (diff)
downloadsamba-81e48dfa35e1b4df6cf46df74572a2ace81c1b84.tar.gz
samba-81e48dfa35e1b4df6cf46df74572a2ace81c1b84.tar.bz2
samba-81e48dfa35e1b4df6cf46df74572a2ace81c1b84.zip
s4/server: simplify and replace bad portable gettimeofday by time
Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Björn Jacke <bj@sernet.de> Autobuild-Date: Mon Jun 6 12:58:26 CEST 2011 on sn-devel-104
-rw-r--r--source4/smbd/server.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 53dc20d636..6acccd14ae 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -178,13 +178,7 @@ _NORETURN_ static void max_runtime_handler(struct tevent_context *ev,
struct timeval t, void *private_data)
{
const char *binary_name = (const char *)private_data;
- struct timeval tv;
- struct timezone tz;
- if (gettimeofday(&tv, &tz) == 0) {
- DEBUG(0,("%s: maximum runtime exceeded - terminating, current ts: %d\n", binary_name, (int)tv.tv_sec));
- } else {
- DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
- }
+ DEBUG(0,("%s: maximum runtime exceeded - terminating, current ts: %d\n", binary_name, time(NULL)));
exit(0);
}
@@ -444,14 +438,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
discard_const(binary_name));
if (max_runtime) {
- struct timeval tv;
- struct timezone tz;
-
- if (gettimeofday(&tv, &tz) == 0) {
- DEBUG(0,("Called with maxruntime %d - current ts %d\n", max_runtime, (int)tv.tv_sec));
- } else {
- DEBUG(0,("Called with maxruntime %d\n", max_runtime));
- }
+ DEBUG(0,("Called with maxruntime %d - current ts %d\n", max_runtime, time(NULL)));
tevent_add_timer(event_ctx, event_ctx,
timeval_current_ofs(max_runtime, 0),
max_runtime_handler,