#include "chase.h"
#include "copy.h"
#include "creds-util.h"
+#include "curl-util.h"
#include "device-private.h"
#include "dns-rr.h"
#include "errno-util.h"
#include "web-util.h"
#include "xattr-util.h"
-#include "../import/curl-util.h"
-
/* This implements a client to the AWS' and Azure's "Instance Metadata Service", as well as GCP's "VM
* Metadata", i.e.:
*
'sources' : files(
'imdsd.c',
'imds-util.c'
- ) + import_curl_util_c,
- 'dependencies' : [ libcurl ],
+ ) + curl_util_c,
+ 'dependencies' : [libcurl],
},
libexec_template + {
'name' : 'systemd-imds',
# SPDX-License-Identifier: LGPL-2.1-or-later
-import_curl_util_c = files('curl-util.c')
-
if conf.get('ENABLE_IMPORTD') != 1
subdir_done()
endif
'pull-oci.c',
'pull-raw.c',
'pull-tar.c',
- ) + import_curl_util_c,
+ ) + curl_util_c,
'objects' : ['systemd-importd'],
'dependencies' : common_deps + [
libopenssl,
#include "alloc-util.h"
#include "build.h"
#include "conf-parser.h"
+#include "curl-util.h"
#include "daemon-util.h"
#include "env-file.h"
#include "extract-word.h"
#define STATE_FILE "/var/lib/systemd/journal-upload/state"
-#define easy_setopt(curl, log_level, opt, value) ({ \
- CURLcode code = curl_easy_setopt(ASSERT_PTR(curl), opt, value); \
- if (code) \
- log_full(log_level, \
- "curl_easy_setopt %s failed: %s", \
- #opt, curl_easy_strerror(code)); \
- !code; \
-})
-
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURL*, curl_easy_cleanup, NULL);
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct curl_slist*, curl_slist_free_all, NULL);
-
static size_t output_callback(char *buf,
size_t size,
size_t nmemb,
#include "shared-forward.h"
+#define easy_setopt(curl, log_level, opt, value) ({ \
+ CURLcode code = curl_easy_setopt(ASSERT_PTR(curl), opt, value); \
+ if (code) \
+ log_full(log_level, \
+ "curl_easy_setopt %s failed: %s", \
+ #opt, curl_easy_strerror(code)); \
+ code == CURLE_OK; \
+})
+
+DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURL*, curl_easy_cleanup, NULL);
+DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURLM*, curl_multi_cleanup, NULL);
+DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct curl_slist*, curl_slist_free_all, NULL);
+
typedef struct CurlGlue CurlGlue;
typedef struct CurlGlue {
struct curl_slist *curl_slist_new(const char *first, ...) _sentinel_;
int curl_header_strdup(const void *contents, size_t sz, const char *field, char **value);
int curl_parse_http_time(const char *t, usec_t *ret);
-
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURL*, curl_easy_cleanup, NULL);
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(CURLM*, curl_multi_cleanup, NULL);
-DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct curl_slist*, curl_slist_free_all, NULL);
shared_sources += files('tests.c')
endif
+# A small shared file that is is linked into a few places
+curl_util_c = files('curl-util.c')
+
syscall_list_inc = custom_target(
input : syscall_list_txt,
output : 'syscall-list.inc',