summaryrefslogtreecommitdiff
path: root/src/main-utils.h
Commit message (Collapse)AuthorAgeFilesLines
* all: SPDX header conversionLubomir Rintel2019-09-101-14/+1
| | | | | $ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
* all: drop emacs file variables from source filesThomas Haller2019-06-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
* all: cleanup includes in header filesThomas Haller2016-08-171-2/+0
| | | | | | | | | | | | - don't include "nm-default.h" in header files. Every source file must include as first header "nm-default.h", thus our headers get the default include already implicitly. - we don't support compiling NetworkManager itself with a C++ compiler. Remove G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support users of libnm to use C++, thus they stay in public headers. (cherry picked from commit f19aff89095ca192b8b2e37534b7a899aecd82f9)
* main: create parent directories of NMSTATEDIR with permissions 755Thomas Haller2016-03-211-0/+1
| | | | | In case, "$PREFIX/var/lib" does not exist, we want to create those directories with permissions 755, not 700.
* all: make use of new header file "nm-default.h"Thomas Haller2015-08-051-1/+1
|
* all: rename nm-glib-compat.h to nm-glib.h, use everywhereDan Winship2015-07-241-1/+1
| | | | | | | | | | | | | | | | Rather than randomly including one or more of <glib.h>, <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to nm-glib.h, include <gio/gio.h> from there, and then change all .c files in NM to include "nm-glib.h" rather than including the glib headers directly. (Public headers files still have to include the real glib headers, since nm-glib.h isn't installed...) Also, remove glib includes from header files that are already including a base object header file (which must itself already include the glib headers).
* config: pass signals to nm_config_reload()Thomas Haller2015-06-251-1/+1
| | | | | | | Also react on SIGUSR1 and SIGUSR2, beside SIGHUP. Only for SIGHUP actually reload the configuration from disc. For the other signals only emit a config-changed signal.
* main: (order) move root user check after help/version optionThomas Haller2015-03-201-0/+2
| | | | | With this change, `NetworkManager --help` and `NetworkManager --version` work for non-root user.
* main: refactor nm_main_utils_check_pidfile() to exit directly on failureThomas Haller2015-03-201-1/+1
| | | | | | | | | | | | | | | | And rename the function to nm_main_utils_ensure_not_running_pidfile() to match the other _ensure_ functions that exit(1). Also no longer pass @name to nm_main_utils_ensure_not_running_pidfile() and use g_get_prgname() instead. nm_main_utils_ensure_not_running_pidfile() checks that the running process has the same program name, so this changes behavior if the user renamed the binary. Before, we would check whether the running process is named 'NetworkManager' ('nm-iface-helper'). Now we check whether the process has the same name as the current process. This means, that if you rename the binary to 'NetworkManager2' we would now only detect a conflicting 'NetworkManager2'. Before we would only detect conflicting 'NetworkManager' binaries.
* main: split out nm_main_utils_ensure_rundir ()Thomas Haller2015-03-201-0/+2
| | | | Also, don't use nm_log_err() as nm-logging is not yet setup.
* main/trivial: change order of arguments for nm_main_utils_early_setup()Thomas Haller2015-03-201-1/+1
| | | | | Change the order of the argv and argc argument to match the main() function.
* config: add handler for SIGHUP and a reload-configuration stubThomas Haller2015-02-031-0/+5
|
* config: add nm_config_setup() to initialize config singletonThomas Haller2015-02-031-1/+2
| | | | | | | | | Make nm_config_new() usable without accessing static/singleton data. nm_config_setup() is now used to initialize the singleton. Still, you must not call nm_config_get() before calling nm_config_setup() or after freeing the provided singleton instance.
* core: use GUnixSignalWatchSource to simplify signal handlingDan Winship2015-01-191-1/+1
| | | | | | | | | Replace the pthread_sigwait()-based signal handling with g_unix_signal_add()-based handling, and get rid of all the now-unnecessary calls to nm_unblock_posix_signals() when spawning subprocesses. As a bonus, this also fixes the "^C in gdb kills NM too" bug.
* core: split signal/pidfile/option handling into separate source fileDan Williams2014-11-071-0/+39
We'll use this from more than one spot.