Commit Graph

46 Commits

Author SHA1 Message Date
Alexander Barton a13bb78b1e Update copyright notices of recently changed files 2014-03-17 12:22:00 +01:00
Alexander Barton b130b35f48 Update #include's: remove unused and add missing ones
The "deheader" tool (<http://www.catb.org/~esr/deheader/>) has been
used to find unused #include directives as well as missing ones.

Tested on:

- A/UX 3.1.1
- ArchLinux (2014-03-17)
- Debian GNU/Hurd
- Debian GNU/Linux 6.0.9
- Debian GNU/Linux 7.4
- Fedora 20
- FreeBSD 9.2
- OpenBSD 4.8
- OpenBSD 5.1
- OS X 10.9
- Solaris 11
2014-03-17 11:37:25 +01:00
Alexander Barton 7b10a0e4ee io.c: <sys/time.h> is only needed when using select()
Only include the <sys/time.h> header when using the select() IO API,
it isn't required otherwise.
2014-03-17 00:45:07 +01:00
Alexander Barton d38d153f51 Streamline punctuation of log messages
Make sure that all log messages end with a correct punctuation mark.

The rules for formatting log messages are:

 1. Add punctuation marks to all messages passed to the actual logging
    functions like Log() and LogDebug().
 2. Don't add any punctuation marks to messages that are stored in
    variables for later use or are passed over the network.
 3. IP addresses, DNS host names and IRC server names should be quoted.
 4. Messages originating in the network should be quoted (at least if
    they are "untrusted" or variable).

Most probably this patch doesn't fix all mistakes, but it should be a
good starting point ...
2013-01-26 17:00:03 +01:00
Alexander Barton d2d867ea36 Define EV_SET() for kqueue() on systems that don't have it
Some systems, notably FreeBSD 4.x, do have the kqueue() function but
lack the definition of EV_SET() in their header files -- but don't
worry, we can #define it on our own ;-)

Definition taken from /usr/include/sys/event.h of FreeBSD 8.1.
Patch tested on FreeBSD 4.1 by Götz Hoffart. Thanks!
2012-09-04 23:28:32 +02:00
Florian Westphal 44bb22d23e io: use define for number of possible events 2012-01-24 22:25:22 +01:00
Florian Westphal c7dd5ea0ba io: remove outer do {} while loops for epoll/kqueue/devpoll backends
simplifies things a bit. io_dispatch() is called repeatedly from the
main loop.
2012-01-24 21:57:23 +01:00
Alexander Barton 8e193df973 Only use poll() when poll.h exists as well 2011-11-25 22:06:44 +01:00
Alexander Barton 2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton 03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +01:00
Alexander Barton 596bc096b0 Make sourcecode compatible with ansi2knr again
This allows to compile ngIRCd using a pre-ANSI K&R C compiler again:
all source files are automatically converted by the included ansi2knr
program (of GNU automake/autoconf) before compiling them with the
K&R C compiler, but a few coding standards must be met.

Tested on Apple A/UX 3.x.
Regression testing on Linux and Mac OS X.
2010-10-24 21:48:32 +02:00
Alexander Barton 99e08eaced Only try to set FD_CLOEXEC if this flag is defined
A/UX 3.x doesn't implement this constant, for example.
2010-10-19 22:17:12 +02:00
Florian Westphal c135d0dded io: add io_cloexec to set close-on-exec flag. 2010-09-11 11:36:12 +02:00
Alexander Barton 37ee0a3313 io.c: Include conn.h when using the select() API 2010-07-12 13:24:45 +02:00
Alexander Barton 54e67ea9ee New "module" proc.c/proc.h for generic process handling
The new "module" proc.c is used for functions dealing with child
processes. At the moment, it is only used by the asynchronous resolver.

All the functions already implemented habe been migrated from the
resolver code base, and the rest of the ngIRCd source code has been
adepted to the new namespace and calling conventions.

The goal is to develop "generic" process handling functions that can
be used for other purposes as well, e.g. running processes on client
connects etc.
2010-06-29 22:55:27 +02:00
Florian Westphal 637d739285 io.c: kill select FD_SETSIZE sanity check in io_library_init.
We already have way too many.
2008-04-03 23:20:26 +02:00
Florian Westphal 66e68de16a io.c: fix select FD_SETSIZE check when using epoll as io backend 2008-04-03 23:20:22 +02:00
Florian Westphal 7f44a2ad1c io.c: try to cut down the number of ifdefs.
consolidate backend-specific helpers and
add empty statinc inle stubs in the ifndef case
to let the compiler remove the functions at compile time.
2008-03-27 16:53:39 +01:00
Florian Westphal 91a6fffaa0 io_event_disable: return if event-to-disable is already off 2008-01-02 10:29:51 +00:00
Florian Westphal 2ce5b734bd kqueue: check for EV_ERROR in .flags
if kevent() returns events, check for EV_ERROR in event flags, too.
2007-12-27 18:25:26 +00:00
Alexander Barton 06bfb3adfb Fix code to compile using K&R C compiler and ansi2kr again. 2007-11-18 15:05:35 +00:00
Florian Westphal ea2a4b3370 fix broken IO_DEBUG build 2007-01-19 13:52:54 +00:00
Florian Westphal f9b9850662 io_event_add: return if eventtype is already registered. 2007-01-18 00:25:26 +00:00
Alexander Barton 5c78230283 New configure option "--without-select"; when usin epoll() IO API include
support for select() as well by default and fall back on runtime when needed.
2006-12-26 16:00:45 +00:00
Florian Westphal 8cb0e3af68 removed errouneous FD_SETSIZE limit when not using select() 2006-12-16 22:48:34 +00:00
Florian Westphal a2f5a05ff8 io_close_poll()s closing brace mysteriously disappeared... fixed. 2006-09-19 18:21:30 +00:00
Florian Westphal 639eb40035 Added support for the /dev/poll i/o interface. 2006-09-17 10:41:06 +00:00
Florian Westphal 0d6f9d4e3e simplify io_library_init* 2006-09-16 16:47:27 +00:00
Florian Westphal 147de9dfa9 add support for the poll() interface 2006-09-16 15:00:09 +00:00
Florian Westphal f6e729443e cleanup 2006-09-16 14:49:26 +00:00
Alexander Barton 184eb1c54b Removed unused variable "ret" when using the select() API. 2006-07-23 23:11:44 +00:00
Florian Westphal 3833f8aae3 remove fd from io_event structure 2006-07-12 19:27:12 +00:00
Florian Westphal 0a3f562f36 make splint complain less... 2006-05-10 17:33:36 +00:00
Florian Westphal 9dfd42a7e6 disabled most (rather annoying) debug messages using DEBUG_ARRAY / DEBUG_IO defines 2006-05-09 17:02:40 +00:00
Florian Westphal 185004cb30 kqueue support was completely broken; seemed to work on FreeBSD just because of sheer luck. 2006-05-07 10:54:42 +00:00
Florian Westphal 565129f992 io_close(): explicitly remove fd from epoll set 2005-09-04 13:38:59 +00:00
Florian Westphal 30c11b2313 use size_t for array length variables 2005-08-30 13:38:16 +00:00
Florian Westphal db992975eb last cleanup accidentally broke kqueue backend. 2005-08-29 13:58:54 +00:00
Florian Westphal 12e288c062 removed misleading const qualifier 2005-08-27 23:23:54 +00:00
Florian Westphal f36337fab3 fix kevent() warning on powerpc-apple-darwin8-gcc-4.0.0 2005-08-27 20:27:07 +00:00
Florian Westphal 1a46b37bd5 remove unneeded call io_event_kqueue_commit_cache() 2005-08-27 20:25:54 +00:00
Florian Westphal fca29bfa23 prevent io_masterfd leak when library_init() is called twice 2005-07-14 14:35:38 +00:00
Alexander Barton 63db3daafe Cleaned up some log messages. 2005-07-14 09:20:39 +00:00
Florian Westphal ca130e6db6 removed unneeded return statement 2005-07-12 20:44:13 +00:00
Florian Westphal dd003e23b7 removed some Debug-Code. 2005-07-09 20:23:00 +00:00
Florian Westphal 7eca418465 add new IO layer 2005-07-07 18:38:35 +00:00