]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Made fatal shm_open() errors more detailed to triage failing tests/testRock.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Oct 2011 21:59:16 +0000 (15:59 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Oct 2011 21:59:16 +0000 (15:59 -0600)
src/ipc/mem/Segment.cc

index bb4b543f86eb04af94d48470482df8be9657c9e3..e897ced9f4b63bbeb3e1ca687e0ee758c349282f 100644 (file)
@@ -66,7 +66,8 @@ Ipc::Mem::Segment::create(const off_t aSize)
                      S_IRUSR | S_IWUSR);
     if (theFD < 0) {
         debugs(54, 5, HERE << "shm_open " << theName << ": " << xstrerror());
-        fatal("Ipc::Mem::Segment::create failed to shm_open");
+        fatalf("Ipc::Mem::Segment::create failed to shm_open(%s): %s\n",
+               theName.termedBuf(), xstrerror());
     }
 
     if (ftruncate(theFD, aSize)) {
@@ -93,9 +94,8 @@ Ipc::Mem::Segment::open()
     theFD = shm_open(theName.termedBuf(), O_RDWR, 0);
     if (theFD < 0) {
         debugs(54, 5, HERE << "shm_open " << theName << ": " << xstrerror());
-        String s = "Ipc::Mem::Segment::open failed to shm_open ";
-        s.append(theName);
-        fatal(s.termedBuf());
+        fatalf("Ipc::Mem::Segment::open failed to shm_open(%s): %s\n",
+               theName.termedBuf(), xstrerror());
     }
 
     theSize = statSize("Ipc::Mem::Segment::open");