Zbigniew Jędrzejewski-Szmek
55cdd057b9
tree-wide: rename hidden_file to hidden_or_backup_file and optimize
...
In standard linux parlance, "hidden" usually means that the file name starts
with ".", and nothing else. Rename the function to convey what the function does
better to casual readers.
Stop exposing hidden_file_allow_backup which is rather ugly and rewrite
hidden_file to extract the suffix first. Note that hidden_file_allow_backup
excluded files with "~" at the end, which is quite confusing. Let's get
rid of it before it gets used in the wrong place.
2016-04-28 08:25:17 -04:00
Zbigniew Jędrzejewski-Szmek
78e334b50f
basic/util: silence stupid gcc warnings about unitialized variable
2016-04-13 08:56:44 -04:00
Lennart Poettering
27c06cb516
core: rework reboot parameter logic a bit
...
Always warn if something fails, and clarify that the involved utility functions
do so in their name.
Drop the REBOOT_PARAM_FILE macro. We don't do this for other flag file paths
like this, so don't do this for this one either. The path isn't configurable
anyway, hence let's make this easier to read by avoiding this one indirection.
2016-04-12 13:43:32 +02:00
Lennart Poettering
8612da973d
core: be more paranoid when mixing umask and fopen()
...
Let's be extra careful with the umask when we use simple fopen(), as this
creates files with 0777 by default.
2016-04-12 13:43:32 +02:00
Zbigniew Jędrzejewski-Szmek
94edd38e1d
basic/util: check return value of dup2 in fork_agent()
...
CID #1304689 .
2016-04-08 21:08:29 -04:00
Daniel Mack
b26fa1a2fb
tree-wide: remove Emacs lines from all files
...
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Zbigniew Jędrzejewski-Szmek
b326715278
tree-wide: check if errno is greater than zero (2)
...
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive.
2016-01-13 15:10:17 -05:00
Thomas Hindoe Paaboel Andersen
93cc7779e0
basic: re-sort includes
...
My previous patch to only include what we use accidentially placed
the added inlcudes in non-sorted order.
2015-12-01 23:40:17 +01:00
Thomas Hindoe Paaboel Andersen
11c3a36649
basic: include only what we use
...
This is a cleaned up result of running iwyu but without forward
declarations on src/basic.
2015-11-30 21:51:03 +01:00
Lennart Poettering
4a0b58c4a3
tree-wide: use right cast macros for UIDs, GIDs and PIDs
2015-11-17 00:52:10 +01:00
Thomas Hindoe Paaboel Andersen
cf0fbc49e6
tree-wide: sort includes
...
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering
4fee397531
util-lib: move fdname_is_valid() to fd-util.[ch]
2015-10-27 14:57:44 +01:00
Lennart Poettering
7b3e062cb6
process-util: move a couple of process-related calls over
2015-10-27 14:24:58 +01:00
Lennart Poettering
405f8907b9
process-util: actually move rename_process() over
...
The prototype was moved long ago, actually move the definition over now,
too.
2015-10-27 13:56:40 +01:00
Lennart Poettering
4e036b7a96
mount-util: move fstype_is_network() and name_to_handle_at() definitions over
2015-10-27 13:45:53 +01:00
Lennart Poettering
b5efdb8af4
util-lib: split out allocation calls into alloc-util.[ch]
2015-10-27 13:45:53 +01:00
Lennart Poettering
7d50b32a12
util-lib: split out globbing related calls into glob-util.[ch]
2015-10-27 13:25:58 +01:00
Lennart Poettering
49cf4170d0
util-lib: move web-related calls into web-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7ccbd1ae84
util-lib: split out syslog-related calls into syslog-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
7f4b3c5ea3
util-lib: move running_in_chroot() into virt.[ch]
...
It's a very weak kind of virtualization, after all.
2015-10-27 13:25:57 +01:00
Lennart Poettering
4e731273ed
util-lib: move /proc/cmdline parsing code to proc-cmdline.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
d4510856a0
util-lib: move is_main_thread() to process-util.[ch]
2015-10-27 13:25:57 +01:00
Lennart Poettering
8752c5752f
util-lib: move more locale-related calls to locale-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
8b43440b7e
util-lib: move string table stuff into its own string-table.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
8fcde01280
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f3e2e81d53
util: move string_is_safe() to string-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
f4f15635ec
util-lib: move a number of fs operations into fs-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
c8b3094de5
util-lib: split out file attribute calls to chattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
89a5a90cb0
util-lib: split xattr-related calls into xattr-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
a09561746f
util-lib: introduce dirent-util.[ch] for directory entry calls
...
Also, move a couple of more path-related functions to path-util.c.
2015-10-27 13:25:56 +01:00
Lennart Poettering
78f22b973f
util-lib: split out resource limits related calls into rlimit-util.[ch]
2015-10-27 13:25:56 +01:00
Lennart Poettering
e929bee09a
util-lib: move take_password_lock() to user-util.[ch]
...
Also, rename it take_etc_passwd_lock(), in order to make it more
expressive.
2015-10-27 13:25:55 +01:00
Lennart Poettering
bb15fafe9c
util: move filename_is_valid() and path_is_safe() to path-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
4349cd7c1d
util-lib: move mount related utility calls to mount-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
6550203eb4
util-lib: move fstab_node_to_udev_node() to fstab-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
0d39fa9c69
util-lib: move more file I/O related calls into fileio.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
5f311f8c0e
util: remove path_get_parent(), in favour of dirname_malloc()
...
We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-util.[ch].
2015-10-27 13:25:55 +01:00
Lennart Poettering
e4e73a6325
util-lib: split out hex/dec/oct encoding/decoding into its own file
2015-10-27 13:25:55 +01:00
Lennart Poettering
6bedfcbb29
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch]
2015-10-27 13:25:55 +01:00
Lennart Poettering
4d0d3d41d2
process-util: move more process related calls to process-util.[ch]
2015-10-26 01:24:39 +01:00
Lennart Poettering
2583fbea8e
socket-util: move remaining socket-related calls from util.[ch] to socket-util.[ch]
2015-10-26 01:24:39 +01:00
Lennart Poettering
b1d4f8e154
util-lib: split out user/group/uid/gid calls into user-util.[ch]
2015-10-26 01:24:38 +01:00
Lennart Poettering
c004493cde
util-lib: split out IO related calls to io-util.[ch]
2015-10-26 01:24:38 +01:00
Lennart Poettering
3ffd4af220
util-lib: split out fd-related operations into fd-util.[ch]
...
There are more than enough to deserve their own .c file, hence move them
over.
2015-10-25 13:19:18 +01:00
Lennart Poettering
07630cea1f
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
...
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Lennart Poettering
4f5dd3943b
util: split out escaping code into escape.[ch]
...
This really deserves its own file, given how much code this is now.
2015-10-24 23:04:42 +02:00
Lennart Poettering
84ac7bea36
util: split out extract_first_word() and related calls into extract-word.[ch]
...
This is quite a lot of code these days, hence move it to its own source
file.
2015-10-24 23:03:49 +02:00
Lennart Poettering
d3aacce707
Merge pull request #1652 from filbranden/extract1
...
util: Replace state with separate booleans in extract_first_word
2015-10-23 13:46:03 +02:00
Daniel Mack
952b4473bc
Merge pull request #1641 from poettering/btrfs-quota
...
btrfs quota beef up and various other unrelated changes
2015-10-23 10:50:53 +02:00
Filipe Brandenburger
4cbf8afa04
util: Replace state with separate booleans in extract_first_word
...
This simplifies the logic and uniformizes the way single and double
quotes are handled. In the end, the code is about 40 lines shorter.
Tested by running the excellent test cases from test-util. Also
installed the systemd binaries including this patch and booted a
system with it, everything looked normal.
2015-10-22 23:12:31 -07:00