util-lib: split out allocation calls into alloc-util.[ch]

This commit is contained in:
Lennart Poettering
2015-10-27 13:45:53 +01:00
parent 7d50b32a12
commit b5efdb8af4
399 changed files with 692 additions and 233 deletions
+3 -2
View File
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "alloc-util.h"
#include "string-util.h"
#include "timesyncd-manager.h"
#include "timesyncd-server.h"
@@ -35,16 +36,16 @@ int manager_parse_server_string(Manager *m, ServerType type, const char *string)
first = type == SERVER_FALLBACK ? m->fallback_servers : m->system_servers;
for (;;) {
_cleanup_free_ char *word;
_cleanup_free_ char *word = NULL;
bool found = false;
ServerName *n;
r = extract_first_word(&string, &word, NULL, 0);
if (r < 0)
return log_error_errno(r, "Failed to parse timesyncd server syntax \"%s\": %m", string);
if (r == 0)
break;
/* Filter out duplicates */
LIST_FOREACH(names, n, first)
if (streq_ptr(n->string, word)) {
+1
View File
@@ -33,6 +33,7 @@
#include "sd-daemon.h"
#include "alloc-util.h"
#include "fd-util.h"
#include "fs-util.h"
#include "list.h"
+1
View File
@@ -19,6 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "alloc-util.h"
#include "timesyncd-server.h"
int server_address_new(