]> granicus.if.org Git - apache/commitdiff
* modules/arch/unix/mod_systemd.c (systemd_pre_mpm): Simplify code
authorJoe Orton <jorton@apache.org>
Thu, 4 Oct 2012 11:44:34 +0000 (11:44 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 4 Oct 2012 11:44:34 +0000 (11:44 +0000)
  slightly; no functional change.
  Use AP_DECLARE_MODULE.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1393997 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/unix/mod_systemd.c

index 0db076e21a2ca8b0b593055218284465dbe43c08..fa561519494175144282fd870bb8b7ee748f02f3 100644 (file)
 static int systemd_pre_mpm(apr_pool_t *p, ap_scoreboard_e sb_type)
 {
     int rv;
-    pid_t pid;
-    pid = getpid();
 
     ap_extended_status = 1;
 
     rv = sd_notifyf(0, "READY=1\n"
                     "STATUS=Processing requests...\n"
-                    "MAINPID=%lu",
-                    (unsigned long) pid);
+                    "MAINPID=%" APR_PID_T_FMT, getpid());
     if (rv < 0) {
         ap_log_perror(APLOG_MARK, APLOG_ERR, 0, p, APLOGNO(02395)
                      "sd_notifyf returned an error %d", rv);
@@ -91,8 +88,7 @@ static void systemd_register_hooks(apr_pool_t *p)
     ap_hook_monitor(systemd_monitor, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
-module AP_MODULE_DECLARE_DATA systemd_module =
-{
+AP_DECLARE_MODULE(systemd) = {
     STANDARD20_MODULE_STUFF,
     NULL,
     NULL,