aboutsummaryrefslogtreecommitdiff
path: root/lib/process.c
AgeCommit message (Collapse)Author
2013-09-27Remove unused variables and functions.Jarno Rajahalme
Found by Clang. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-06-28Replace all uses of strerror() by ovs_strerror(), for thread safety.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-28ovs-thread: Add support for various thread-related assertions.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-06-10process: Add thread safety comments.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-10process: Make signal handling thread-safe.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-06-10process: Remove unused features from process_start().Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-06-10process: Remove process_run(), process_run_capture(), and related code.Ben Pfaff
They are unused. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com>
2013-06-05signals: Make signal_name() thread-safe.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-05-02Use pthread_sigmask() in place of sigprocmask(), for thread safety.Ben Pfaff
POSIX says that multithreaded programs must not use sigprocmask() but must use pthread_sigmask() instead. This commit makes that replacement. The actual use of signals in Open vSwitch is still not thread safe following this commit, but this change is a necessary prerequisite for fixing the other problems. Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-02-01process: Check return value of set_nonblocking().Ben Pfaff
It's unlikely to fail but checking it can't hurt. Found by Coverity. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-01-16Replace most uses of assert by ovs_assert.Ben Pfaff
This is a straight search-and-replace, except that I also removed #include <assert.h> from each file where there were no assert calls left. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2012-09-28lib: Add xpipe_nonblocking helperEd Maste
Signed-off-by: Ed Maste <emaste@adaranet.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-18socket-util: New function xset_nonblocking().Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-06-07process: Let process_run_capture() caller set maximum capture size.Ben Pfaff
An upcoming patch needs a larger value.
2011-04-04Log anything that could prevent a daemon from starting.Ben Pfaff
If a daemon doesn't start, we need to know why. Being able to consistently consult the log to find out is helpful.
2011-04-04signals: New function signal_name().Ben Pfaff
This will acquire a new user in an upcoming commit.
2011-02-23process: Avoid late failure if /dev/null cannot be opened.Ben Pfaff
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.
2010-11-30coverage: Make the coverage counters catalog program-specific.Ben Pfaff
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.
2010-10-29vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.Ben Pfaff
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon, so this commit switches to the more common form.
2010-10-01Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.Ben Pfaff
These macros require one fewer argument by switching, which makes code that uses them shorter and more readable.
2010-09-20Avoid shadowing local variable names.Ben Pfaff
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.
2010-07-21vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.Ben Pfaff
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.
2010-03-01Properly escape quotes in process_escape_args() library functionJustin Pettit
2010-02-11Merge "master" into "next".Ben Pfaff
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".
2010-02-11Rename UNUSED macro to OVS_UNUSED to avoid naming conflict.Ben Pfaff
Requested by Jean Tourrilhes <jt@hpl.hp.com>.
2010-02-11process: Remove pointless, redundant assignments from stream_read().Ben Pfaff
Found by Clang (http://clang-analyzer.llvm.org/).
2010-01-06fatal-signal: Run signal hooks outside of actual signal handlers.Jesse Gross
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.
2009-12-15Clean-up compiler warnings about ignoring return valuesJustin Pettit
Some systems complain when certain functions' return values are not checked. This commit fixes those warnings. Creating ignore() function suggested by Ben Pfaff.
2009-11-04Add new function xzalloc(n) as a shorthand for xcalloc(1, n).Ben Pfaff
2009-07-16process: New function process_run_capture().Ben Pfaff
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.
2009-07-16process: Factor code out of process_start() into helper functions.Ben Pfaff
An upcoming commit will add a new function that can also use these helper functions.
2009-07-16process: Fix races on fatal signal handling in process_start().Ben Pfaff
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.
2009-07-16Add function get_null_fd(), to reduce code redundancy.Ben Pfaff
2009-06-15Update primary code license to Apache 2.0.Ben Pfaff
2009-07-08Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.v0.90.0Ben Pfaff