<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3610,17 +3610,6 @@ int main (int argc, char **argv) {
         }
     }
 
-    /* daemonize if requested */
-    /* if we want to ensure our ability to dump core, don't chdir to / */
-    if (daemonize) {
-        int res;
-        res = daemon(maxcore, settings.verbose);
-        if (res == -1) {
-            fprintf(stderr, &quot;failed to daemon() in order to daemonize\n&quot;);
-            return 1;
-        }
-    }
-
     /* lock paged memory if needed */
     if (lock_memory) {
 #ifdef HAVE_MLOCKALL
@@ -3650,6 +3639,17 @@ int main (int argc, char **argv) {
         }
     }
 
+    /* daemonize if requested */
+    /* if we want to ensure our ability to dump core, don't chdir to / */
+    if (daemonize) {
+        int res;
+        res = daemon(maxcore, settings.verbose);
+        if (res == -1) {
+            fprintf(stderr, &quot;failed to daemon() in order to daemonize\n&quot;);
+            return 1;
+        }
+    }
+
     /* initialize main thread libevent instance */
     main_base = event_init();
 </diff>
      <filename>memcached.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5456a9fd8507165e591327e6850c23d6bc584bee</id>
    </parent>
  </parents>
  <author>
    <name>Toru Maesaka</name>
    <email>dev@torum.net</email>
  </author>
  <url>http://github.com/tmaesaka/memcached/commit/737b4afde2249acbc7a66920e2b1134a74205d5e</url>
  <id>737b4afde2249acbc7a66920e2b1134a74205d5e</id>
  <committed-date>2008-06-18T01:14:18-07:00</committed-date>
  <authored-date>2008-06-18T01:14:18-07:00</authored-date>
  <message>Fixed a minor merge glitch, which had moved the daemonize routine to
before the memory lock routine.</message>
  <tree>50786a6b1f51388a4d136244bbe4d77cec4af388</tree>
  <committer>
    <name>Toru Maesaka</name>
    <email>dev@torum.net</email>
  </committer>
</commit>
