From: Gerald Carter Date: Mon, 15 Mar 2004 15:06:33 +0000 (+0000) Subject: fix byte ordering problem when storing the updating pid for the lpq cache; was causin... X-Git-Tag: samba-4.0.0alpha6~801^2~11825 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbe9e8a4cbd266990a68f66559bcaff896bc4d51;p=thirdparty%2Fsamba.git fix byte ordering problem when storing the updating pid for the lpq cache; was causing an abort in process_exists() on solaris (This used to be commit 26681cd2a1567d90cc7d344e8aca6e6a686053f5) --- diff --git a/source3/printing/printing.c b/source3/printing/printing.c index ad11108a5af..ed19c01f243 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -818,6 +818,8 @@ static void set_updating_pid(const fstring printer_name, BOOL delete) TDB_DATA key; TDB_DATA data; pid_t updating_pid = sys_getpid(); + uint8 buffer[4]; + struct tdb_print_db *pdb = get_print_db_byname(printer_name); if (!pdb) @@ -833,8 +835,9 @@ static void set_updating_pid(const fstring printer_name, BOOL delete) return; } - data.dptr = (void *)&updating_pid; - data.dsize = sizeof(pid_t); + SIVAL( buffer, 0, updating_pid); + data.dptr = (void *)buffer; + data.dsize = 4; /* we always assume this is a 4 byte value */ tdb_store(pdb->tdb, key, data, TDB_REPLACE); release_print_db(pdb);