gcm_daemon: Use lock file to prevent parallel execution
[gnucomo.git] / src / gcm_input / gcm_input.cpp
index a4b8937..112290f 100644 (file)
@@ -251,11 +251,7 @@ int main(int argc, char *argv[])
 
    if (log_method == "file" && log_destination != "")
    {
-#if __GNUC__ == 2
-      logfile.open(log_destination, _IO_APPEND); // for gcc 2
-#else
-      logfile.open(log_destination, std::ios_base::app); // for gcc 3
-#endif
+      logfile.open(log_destination, std::ios_base::app);
       if (!logfile)
       {
          std::cerr << "Can't open logfile " << log_destination << " for writing.\n";
@@ -267,6 +263,8 @@ int main(int argc, char *argv[])
    }
    verbose = verbose || level > 0;
 
+   *Log << Now() << " gcm_input starting.\n";
+
    if (verbose)
    {
       *Log << "Hostname = " << hostname;
@@ -334,6 +332,7 @@ int main(int argc, char *argv[])
 
             gcm_input_result = 1;
          }
+         *Log << Now() << " gcm_input finished successfully.\n";
       }
       catch (std::exception &e)
       {