]> Pileus Git - lackey/blobdiff - src/main.c
Rename
[lackey] / src / main.c
index 4161b031deb31d77ed554a8d64f9bdb1e959a654..1327a8240a6327882cb237a3800cf8b39224ffc3 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2012 Andy Spencer <andy753421@gmail.com>
+ * 
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #define _POSIX_C_SOURCE 1
 #include <stdarg.h>
 #include <stdlib.h>
@@ -32,6 +49,10 @@ int debug(char *fmt, ...)
        int rval;
        va_list ap;
 
+       /* Open log file */
+       if (!debug_fd)
+               debug_fd = fopen("lackey.log", "w+");
+
        /* Log to debug file */
        va_start(ap, fmt);
        vfprintf(debug_fd, "debug: ", ap);
@@ -54,7 +75,6 @@ int debug(char *fmt, ...)
 int main(int argc, char **argv)
 {
        /* Misc setup */
-       debug_fd = fopen("acal.log", "w+");
        struct sigaction act;
        sigemptyset(&act.sa_mask);
        act.sa_flags   = 0;