/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
static int DebugLevel = 0;
static int
-do_open(diomsg * r, int len, const char *buf)
+do_open(diomsg * r, int, const char *buf)
{
int fd;
file_state *fs;
}
static int
-do_close(diomsg * r, int len)
+do_close(diomsg * r, int)
{
int fd;
file_state *fs;
}
static int
-do_read(diomsg * r, int len, char *buf)
+do_read(diomsg * r, int, char *buf)
{
int x;
int readlen = r->size;
}
static int
-do_write(diomsg * r, int len, const char *buf)
+do_write(diomsg * r, int, const char *buf)
{
int wrtlen = r->size;
int x;
}
static int
-do_unlink(diomsg * r, int len, const char *buf)
+do_unlink(diomsg * r, int, const char *buf)
{
if (unlink(buf) < 0) {
DEBUG(1) {
return (*k & (--n));
}
-SQUIDCEXTERN {
- static void
- alarm_handler(int sig) {
- (void) 0;
- }
+extern "C" {
+ static void alarm_handler(int) {}
};
int
if (rmsgid < 0) {
perror("msgget");
- return 1;
+ exit(EXIT_FAILURE);
}
key = atoi(argv[2]);
if (smsgid < 0) {
perror("msgget");
- return 1;
+ exit(EXIT_FAILURE);
}
key = atoi(argv[3]);
if (shmid < 0) {
perror("shmget");
- return 1;
+ exit(EXIT_FAILURE);
}
shmbuf = (char *)shmat(shmid, NULL, 0);
if (shmbuf == (void *) -1) {
perror("shmat");
- return 1;
+ exit(EXIT_FAILURE);
}
hash = hash_create(fsCmp, 1 << 4, fsHash);
assert(hash);
if (fcntl(0, F_SETFL, SQUID_NONBLOCK) < 0) {
- perror(xstrerror());
- return 1;
+ perror(xstrerr(errno));
+ exit(EXIT_FAILURE);
}
memset(&sa, '\0', sizeof(sa));
sa.sa_handler = alarm_handler;
if (shmctl(shmid, IPC_RMID, 0) < 0)
perror("shmctl IPC_RMID");
- return 0;
+ return EXIT_SUCCESS;
}
+