summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-09-24 19:05:21 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-09-24 19:05:21 (GMT)
commite498e65b8120ff42e7881d21c88b9d076825cfb3 (patch)
tree908e56835f1659a5153e9471bcc4988d5f23a9ff
parent1e0dfe0e9a0a786fcfdedc124acdd71e968ee468 (diff)
add syslog output for every deleted fileHEADmaster
-rw-r--r--src/klokdisplay.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/klokdisplay.c b/src/klokdisplay.c
index ec2c4bd..299d6dd 100644
--- a/src/klokdisplay.c
+++ b/src/klokdisplay.c
@@ -20,9 +20,16 @@
*/
#include <unistd.h>
+#include <syslog.h>
#include <wand/MagickWand.h>
+void klok_unlink(const char* file)
+{
+ unlink(file);
+ syslog(LOG_INFO, "just deleted: '%s'", file);
+}
+
int main(int argc, char **argv)
{
if(argc < 2) {
@@ -33,18 +40,20 @@ int main(int argc, char **argv)
MagickWand *wand = NULL;
MagickBooleanType status = MagickFalse;
+ openlog("klokdisplay", 0, LOG_LOCAL5);
+
MagickCoreGenesis(*argv, MagickTrue);
wand = NewMagickWand();
if(wand) {
status = MagickReadImage(wand, argv[1]);
- unlink(argv[1]);
+ klok_unlink(argv[1]);
if(status != MagickFalse) {
status = MagickDisplayImage(wand, NULL);
}
wand = DestroyMagickWand(wand);
} else {
- unlink(argv[1]);
+ klok_unlink(argv[1]);
}
MagickCoreTerminus();