mode = flags;
ssize_t shm_offset;
char *buf = (char *)IO->shm.get(&shm_offset);
+ if (!buf) {
+ errorOccured = true;
+ ioRequestor->ioCompletedNotification();
+ ioRequestor = nullptr;
+ return;
+ }
+
xstrncpy(buf, path_, SHMBUF_BLKSZ);
ioAway();
int x = IO->send(_MQD_OPEN,
mode = flags;
ssize_t shm_offset;
char *buf = (char *)IO->shm.get(&shm_offset);
+ if (!buf) {
+ errorOccured = true;
+ notifyClient();
+ ioRequestor = nullptr;
+ return;
+ }
+
xstrncpy(buf, path_, SHMBUF_BLKSZ);
ioAway();
int x = IO->send(_MQD_CREATE,
assert (ioRequestor.getRaw() != nullptr);
ssize_t shm_offset;
char *rbuf = (char *)IO->shm.get(&shm_offset);
- assert(rbuf);
+ if (!rbuf) {
+ errorOccured = true;
+ notifyClient();
+ ioRequestor = nullptr;
+ return;
+ }
ioAway();
int x = IO->send(_MQD_READ,
id,
debugs(79, 3, "DiskdFile::write: this " << (void *)this << ", buf " << (void *)aRequest->buf << ", off " << aRequest->offset << ", len " << aRequest->len);
ssize_t shm_offset;
char *sbuf = (char *)IO->shm.get(&shm_offset);
+ if (!sbuf) {
+ errorOccured = true;
+ if (aRequest->free_func)
+ aRequest->free_func(const_cast<char *>(aRequest->buf));
+ notifyClient();
+ ioRequestor = nullptr;
+ return;
+ }
+
memcpy(sbuf, aRequest->buf, aRequest->len);
if (aRequest->free_func)
buf = (char *)shm.get(&shm_offset);
+ if (!buf) {
+ unlinkdUnlink(path);
+ return;
+ }
+
xstrncpy(buf, path, SHMBUF_BLKSZ);
x = send(_MQD_UNLINK,
break;
}
+ if (!aBuf) {
+ debugs(79, DBG_IMPORTANT, "ERROR: out of shared-memory buffers");
+ return nullptr;
+ }
+
assert(aBuf);
assert(aBuf >= buf);
assert(aBuf < buf + (nbufs * SHMBUF_BLKSZ));