bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] Handling of size=>


From: Iain Morgan
Subject: [Patch] Handling of size=>
Date: Thu, 22 Jan 2004 11:03:56 -0800 (PST)

Hello,

I've been noticing spurious output from cfagent when run with the --inform
option under certain circumstances. I've traced one occurence of this to 
the handling of copy when a minimum file size is specified.

The problem is due to the use of the Silent() macro:

#define Silent if (! SILENT || VERBOSE || DEBUG || D2) printf

the following patch addresses this issue. It may also be worthwhile
having the default: clause in the case statement handle syntax errors
and have an explicit clause for '>'.


--- image.c.orig        Sun Jan 11 05:21:09 2004
+++ image.c     Thu Jan 22 10:32:59 2004
@@ -805,7 +805,7 @@
       default:
          if (sourcestatbuf.st_size < ip->size)
             {
-            Silent(OUTPUT,"Source file %s is < %d bytes in copy 
(omitting)\n",sourcefile,ip->size);
+            snprintf(OUTPUT,bufsize*2,"Source file %s is < %d bytes in copy 
(omitting)\n",sourcefile,ip->size);
             CfLog(cfinform,OUTPUT,"");
             return;
             }

--
Iain Morgan
NAS Desktop Support Group




reply via email to

[Prev in Thread] Current Thread [Next in Thread]