squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
unlinkd_daemon.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3
*
4
* Squid software is distributed under GPLv2+ license and includes
5
* contributions from numerous individuals and organizations.
6
* Please see the COPYING and CONTRIBUTORS files for details.
7
*/
8
9
/* DEBUG: section -- Unlink Daemon */
10
11
#define SQUID_HELPER 1
12
13
#include "
squid.h
"
14
15
#include <iostream>
16
#include <cstdio>
17
#if HAVE_PATHS_H
18
#include <paths.h>
19
#endif
20
32
#define UNLINK_BUF_LEN 1024
33
51
int
52
main
(
int
,
char
*[])
53
{
54
std::string sbuf;
55
close(2);
56
if
(open(_PATH_DEVNULL, O_RDWR) < 0) {
57
;
// the irony of having to close(2) earlier is that we cannot report this failure.
58
}
59
while
(getline(std::cin, sbuf)) {
60
// tailing newline is removed by getline
61
const
int
rv = remove(sbuf.c_str());
62
if
(rv < 0)
63
std::cout <<
"ERR"
<< std::endl;
// endl flushes
64
else
65
std::cout <<
"OK"
<< std::endl;
66
}
67
68
return
EXIT_SUCCESS;
69
}
70
main
int main(int, char *[])
Definition:
unlinkd_daemon.cc:52
squid.h
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Quick Setup
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
il
...
full list
FTP Package Archive