Re: [Bacula-devel] Another job code: %p for pid

2012-11-26 Thread Bastian Friedrich
Hi, Am Donnerstag, 22. November 2012, 10:22:39 schrieb Bastian Friedrich: > The attached (mini-)patch adds the job code %p to bacula's valid job codes, yuck. The %p job code for the current pool was already included in commit 2722f0d8e0b1ca1a738c0398580004bedc605144 -- it went unnoticed, as it i

Re: [Bacula-devel] Another job code: %p for pid

2012-11-23 Thread Kern Sibbald
Hello Martin, On 11/23/2012 12:59 PM, Martin Simmons wrote: >> .. > Ah, sorry, you are right. I didn't know that Bacula had its own format > directives. No reason to be sorry. It is not too well known. There are two reasons we have our own print formatting subroutines: 1. I wanted something m

Re: [Bacula-devel] Another job code: %p for pid

2012-11-23 Thread Martin Simmons
> On Thu, 22 Nov 2012 23:01:45 +0100, Kern Sibbald said: > > Bacula's bsnprintf does not correspond to printf, so any > comparison makes no sense. > > I am not 100% sure what you want to show, but Bastian's code > is correct and using something like "unsigned long" would > probably be incorre

Re: [Bacula-devel] Another job code: %p for pid

2012-11-22 Thread Kern Sibbald
Bacula's bsnprintf does not correspond to printf, so any comparison makes no sense. I am not 100% sure what you want to show, but Bastian's code is correct and using something like "unsigned long" would probably be incorrect -- at least it would be bad Bacula programming practice.Bacula uses a

Re: [Bacula-devel] Another job code: %p for pid

2012-11-22 Thread Martin Simmons
> On Thu, 22 Nov 2012 15:16:54 +0100, Bastian Friedrich said: > > Hi, > > Am Donnerstag, 22. November 2012, 12:30:38 schrieb Martin Simmons: > > > On Thu, 22 Nov 2012 10:22:39 +0100, Bastian Friedrich said: > > > + bsnprintf(add, sizeof(add), "%lu", (uint32_t)getpid()); > > >

Re: [Bacula-devel] Another job code: %p for pid

2012-11-22 Thread Bastian Friedrich
Hi, Am Donnerstag, 22. November 2012, 12:30:38 schrieb Martin Simmons: > > On Thu, 22 Nov 2012 10:22:39 +0100, Bastian Friedrich said: > > + bsnprintf(add, sizeof(add), "%lu", (uint32_t)getpid()); > > Using %lu for uint32_t is wrong on 64-bit systems. Why not cast to unsigned > l

Re: [Bacula-devel] Another job code: %p for pid

2012-11-22 Thread Martin Simmons
> On Thu, 22 Nov 2012 10:22:39 +0100, Bastian Friedrich said: > > + bsnprintf(add, sizeof(add), "%lu", (uint32_t)getpid()); Using %lu for uint32_t is wrong on 64-bit systems. Why not cast to unsigned long? __Martin ---