summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-25 18:27:40 +0000
committerJeremy Allison <jra@samba.org>2002-01-25 18:27:40 +0000
commitb3e5d34171b8e5e6320c28379cb0021bf857efa5 (patch)
tree377fb5279b532def3a4d8973bd4606744599565a
parent214542b8748560b54ccaf6fe731a6b6f1e16ae3a (diff)
downloadsamba-b3e5d34171b8e5e6320c28379cb0021bf857efa5.tar.gz
samba-b3e5d34171b8e5e6320c28379cb0021bf857efa5.tar.bz2
samba-b3e5d34171b8e5e6320c28379cb0021bf857efa5.zip
Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au. Jeremy. (This used to be commit 5f4de275a3a63a95e76d077ffc94321a078833bf)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 57521dc144..8a13ebe19e 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -2009,8 +2009,9 @@ static void spoolss_notify_job_size(int snum,
}
/*******************************************************************
- * fill a notify_info_data with job position
+ Fill a notify_info_data with job position.
********************************************************************/
+
static void spoolss_notify_job_position(int snum,
SPOOL_NOTIFY_INFO_DATA *data,
print_queue_struct *queue,
@@ -2022,8 +2023,9 @@ static void spoolss_notify_job_position(int snum,
}
/*******************************************************************
- * fill a notify_info_data with submitted time
+ Fill a notify_info_data with submitted time.
********************************************************************/
+
static void spoolss_notify_submitted_time(int snum,
SPOOL_NOTIFY_INFO_DATA *data,
print_queue_struct *queue,
@@ -2033,6 +2035,7 @@ static void spoolss_notify_submitted_time(int snum,
struct tm *t;
uint32 len;
SYSTEMTIME st;
+ char *p;
t=gmtime(&queue->time);
@@ -2047,7 +2050,21 @@ static void spoolss_notify_submitted_time(int snum,
}
make_systemtime(&st, t);
- memcpy(data->notify_data.data.string,&st,len);
+
+ /*
+ * Systemtime must be linearized as a set of UINT16's.
+ * Fix from Benjamin (Bj) Kuit bj@it.uts.edu.au
+ */
+
+ p = (char *)data->notify_data.data.string;
+ SSVAL(p, 0, st.year);
+ SSVAL(p, 2, st.month);
+ SSVAL(p, 4, st.dayofweek);
+ SSVAL(p, 6, st.day);
+ SSVAL(p, 8, st.hour);
+ SSVAL(p, 10, st.minute);
+ SSVAL(p, 12, st.second);
+ SSVAL(p, 14, st.milliseconds);
}
#define END 65535