summaryrefslogtreecommitdiff
path: root/lib/process.c
Commit message (Collapse)AuthorAgeFilesLines
* Log anything that could prevent a daemon from starting.Ben Pfaff2011-04-041-15/+7
| | | | | If a daemon doesn't start, we need to know why. Being able to consistently consult the log to find out is helpful.
* signals: New function signal_name().Ben Pfaff2011-04-041-11/+5
| | | | This will acquire a new user in an upcoming commit.
* process: Avoid late failure if /dev/null cannot be opened.Ben Pfaff2011-02-231-6/+18
| | | | | | | It is (very slightly) risky to open /dev/null every time that we need it, because open can fail. So this commit opens /dev/null in advance instead. Coverity #10719.
* coverage: Make the coverage counters catalog program-specific.Ben Pfaff2010-11-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the collection of coverage counters supported by a given OVS program was not specific to that program. That means that, for example, even though ovs-dpctl does not have anything to do with mac_learning, it still has a coverage counter for it. This is confusing, at best. This commit fixes the problem on some systems, in particular on ones that use GCC and the GNU linker. It uses the feature of the GNU linker described in its manual as: If an orphaned section's name is representable as a C identifier then the linker will automatically see PROVIDE two symbols: __start_SECNAME and __end_SECNAME, where SECNAME is the name of the section. These indicate the start address and end address of the orphaned section respectively. Systems that don't support these features retain the earlier behavior. This commit also fixes the annoyance that files that include coverage counters must be listed on COVERAGE_FILES in lib/automake.mk. This commit also fixes the annoyance that modifying any source file that includes a coverage counter caused all programs that link against libopenvswitch.a to relink, even programs that the source file was not linked into. For example, modifying ofproto/ofproto.c (which includes coverage counters) caused tests/test-aes128 to relink, even though test-aes128 does not link again ofproto.o.
* vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.Ben Pfaff2010-10-291-1/+1
| | | | | It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon, so this commit switches to the more common form.
* Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.Ben Pfaff2010-10-011-1/+1
| | | | | These macros require one fewer argument by switching, which makes code that uses them shorter and more readable.
* Avoid shadowing local variable names.Ben Pfaff2010-09-201-1/+1
| | | | | | | | | | | All of these changes avoid using the same name for two local variables within a same function. None of them are actual bugs as far as I can tell, but any of them could be confusing to the casual reader. The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer loops both using (different) variables named 'i'. Found with GCC -Wshadow.
* vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.Ben Pfaff2010-07-211-2/+2
| | | | | | | Adding a macro to define the vlog module in use adds a level of indirection, which makes it easier to change how the vlog module must be defined. A followup commit needs to do that, so getting these widespread changes out of the way first should make that commit easier to review.
* Properly escape quotes in process_escape_args() library functionJustin Pettit2010-03-011-1/+1
|
* Merge "master" into "next".Ben Pfaff2010-02-111-2/+2
|\ | | | | | | | | The main change here is the need to update all of the uses of UNUSED in the next branch to OVS_UNUSED as it is now spelled on "master".
| * Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.Ben Pfaff2010-02-111-3/+3
| | | | | | | | Requested by Jean Tourrilhes <jt@hpl.hp.com>.
* | process: Remove pointless, redundant assignments from stream_read().Ben Pfaff2010-02-111-4/+2
| | | | | | | | Found by Clang (http://clang-analyzer.llvm.org/).
* | fatal-signal: Run signal hooks outside of actual signal handlers.Jesse Gross2010-01-061-8/+0
| | | | | | | | | | | | | | Rather than running signal hooks directly from the actual signal handler, simply record the fact that the signal occured and run the hook next time around the poll loop. This allows significantly more freedom as to what can actually be done in the signal hooks.
* | Clean-up compiler warnings about ignoring return valuesJustin Pettit2009-12-151-2/+2
| | | | | | | | | | | | | | Some systems complain when certain functions' return values are not checked. This commit fixes those warnings. Creating ignore() function suggested by Ben Pfaff.
* | Add new function xzalloc(n) as a shorthand for xcalloc(1, n).Ben Pfaff2009-11-041-1/+1
|/
* process: New function process_run_capture().Ben Pfaff2009-07-161-0/+197
| | | | | | In an upcoming commit, ovs-brcompatd will need to create a subprocess and capture both its stdout and stderr separately, which one cannot do with simple interfaces such as popen(). This function provides that ability.
* process: Factor code out of process_start() into helper functions.Ben Pfaff2009-07-161-29/+69
| | | | | An upcoming commit will add a new function that can also use these helper functions.
* process: Fix races on fatal signal handling in process_start().Ben Pfaff2009-07-161-0/+7
| | | | | | | | | To prevent fatal signals in a child process from causing the parent process's pidfile, etc. to be deleted, we need to block fatal signals around fork and call fatal_signal_fork() in the child process. This problem was noticed through code inspection; it has not been observed in practice.
* Add function get_null_fd(), to reduce code redundancy.Ben Pfaff2009-07-161-0/+2
|
* Update primary code license to Apache 2.0.Ben Pfaff2009-06-151-10/+10
|
* Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff2009-07-081-0/+417