summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-29 14:01:04 +0100
committerGünther Deschner <gd@samba.org>2008-10-31 02:44:30 +0100
commit9fd82703d17b4dc524d2c7689438b92738c63d23 (patch)
tree50d797ea83eba5c754955d07566c976005cefccf /source4/rpc_server
parentf61ce2fe41eebef20d3bba471e625d835555d5d8 (diff)
downloadsamba-9fd82703d17b4dc524d2c7689438b92738c63d23.tar.gz
samba-9fd82703d17b4dc524d2c7689438b92738c63d23.tar.bz2
samba-9fd82703d17b4dc524d2c7689438b92738c63d23.zip
s4-srvsvc: merge srvsvc_NetRemoteTOD from s3 idl.
Guenther
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/srvsvc/dcesrv_srvsvc.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
index 90fba297e3..8a5f6708c3 100644
--- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
+++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
@@ -1688,31 +1688,34 @@ static WERROR dcesrv_srvsvc_NetRemoteTOD(struct dcesrv_call_state *dce_call, TAL
struct timeval tval;
time_t t;
struct tm tm;
+ struct srvsvc_NetRemoteTODInfo *info;
- r->out.info = talloc(mem_ctx, struct srvsvc_NetRemoteTODInfo);
- W_ERROR_HAVE_NO_MEMORY(r->out.info);
+ info = talloc(mem_ctx, struct srvsvc_NetRemoteTODInfo);
+ W_ERROR_HAVE_NO_MEMORY(info);
GetTimeOfDay(&tval);
t = tval.tv_sec;
gmtime_r(&t, &tm);
- r->out.info->elapsed = t;
+ info->elapsed = t;
/* TODO: fake the uptime: just return the milliseconds till 0:00:00 today */
- r->out.info->msecs = (tm.tm_hour*60*60*1000)
- + (tm.tm_min*60*1000)
- + (tm.tm_sec*1000)
- + (tval.tv_usec/1000);
- r->out.info->hours = tm.tm_hour;
- r->out.info->mins = tm.tm_min;
- r->out.info->secs = tm.tm_sec;
- r->out.info->hunds = tval.tv_usec/10000;
- r->out.info->timezone = get_time_zone(t)/60;
- r->out.info->tinterval = 310; /* just return the same as windows */
- r->out.info->day = tm.tm_mday;
- r->out.info->month = tm.tm_mon + 1;
- r->out.info->year = tm.tm_year + 1900;
- r->out.info->weekday = tm.tm_wday;
+ info->msecs = (tm.tm_hour*60*60*1000)
+ + (tm.tm_min*60*1000)
+ + (tm.tm_sec*1000)
+ + (tval.tv_usec/1000);
+ info->hours = tm.tm_hour;
+ info->mins = tm.tm_min;
+ info->secs = tm.tm_sec;
+ info->hunds = tval.tv_usec/10000;
+ info->timezone = get_time_zone(t)/60;
+ info->tinterval = 310; /* just return the same as windows */
+ info->day = tm.tm_mday;
+ info->month = tm.tm_mon + 1;
+ info->year = tm.tm_year + 1900;
+ info->weekday = tm.tm_wday;
+
+ *r->out.info = info;
return WERR_OK;
}