Fixes #9320.
for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
/* SPDX-License-Identifier: MIT */
-/* Copyright © 2014 Tom Gundersen */
#include <stdlib.h>
//#include <elogind/sd-event.h>
//#include <glib.h>
-//#include <elogind/sd-event.h>
+#include <glib.h>
+#include <systemd/sd-event.h>
typedef struct SDEventSource {
GSource source;
#
# This file is part of elogind.
#
-# Copyright © 2018 Yu Watanabe
#
# elogind is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
#
# This file is part of elogind.
#
-# Copyright © 2018 Yu Watanabe
#
# elogind is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2010-2012 Kay Sievers
-***/
enum {
CONF_FILES_EXECUTABLE = 1 << 0,
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2015 Ronny Chevalier
-***/
#include <inttypes.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include <string.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include "macro.h"
#include "siphash24.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include <errno.h>
#include <stdint.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include <limits.h>
#include <stdbool.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include <stdint.h>
#include <stdlib.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2014 Michal Schmidt
-***/
#include <stddef.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Kay Sievers
-***/
#include <stdio.h>
#include <sys/stat.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2013 Kay Sievers
-***/
#include <sys/types.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2014 Tom Gundersen
-***/
#include <endian.h>
#include <stdint.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2008-2011 Kay Sievers
-***/
/* Parts of this file are based on the GLIB utf8 validation functions. The
* original license text follows. */
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 David Herrmann
-***/
#include <fcntl.h>
#include <linux/input.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-/***
- Copyright © 2013 David Herrmann
-***/
typedef enum DeviceType DeviceType;
typedef struct SessionDevice SessionDevice;
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2015 Daniel Mack
-***/
#include <errno.h>
#include <pwd.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2015 Ronny Chevalier
-***/
#include "conf-parser.h"
#include "fd-util.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Ronny Chevalier
-***/
#include <unistd.h>
unlink(fn3);
}
+static void test_copy_atomic(void) {
+ _cleanup_(rm_rf_physical_and_freep) char *p = NULL;
+ const char *q;
+ int r;
+
+ assert_se(mkdtemp_malloc(NULL, &p) >= 0);
+
+ q = strjoina(p, "/fstab");
+
+ r = copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REFLINK);
+ if (r == -ENOENT)
+ return;
+
+ assert_se(copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REFLINK) == -EEXIST);
+
+ assert_se(copy_file_atomic("/etc/fstab", q, 0644, 0, COPY_REPLACE) >= 0);
+}
+
int main(int argc, char *argv[]) {
+ log_set_max_level(LOG_DEBUG);
#if 0 /// UNNEEDED by elogind
test_copy_file();
test_copy_bytes_regular_file(argv[0], true, 1000);
test_copy_bytes_regular_file(argv[0], false, 32000); /* larger than copy buffer size */
test_copy_bytes_regular_file(argv[0], true, 32000);
+ test_copy_atomic();
return 0;
}
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Shawn Landden
-***/
#include <stdio.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <string.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <stdlib.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Ronny Chevalier
-***/
#include "locale-util.h"
#include "macro.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <locale.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <sched.h>
#include <sys/mount.h>
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2015 Tom Gundersen
-***/
#include "siphash24.h"
#include "util.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2014 Tom Gundersen
-***/
#include "sparse-endian.h"
#include "unaligned.h"
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- Copyright © 2013 Thomas H.P. Andersen
-***/
#include <errno.h>
#include <string.h>
#!/usr/bin/env python3
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
# SPDX-License-Identifier: LGPL-2.1+
-#
-# Copyright © 2014 Michal Schmidt
import gdb