]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-fd-util.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / test / test-fd-util.c
index f555bb976ccc31c8c407d64fe80640ade9740b7a..4ad8fe75ea61e39632c8ee397270806e7b55c758 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -94,10 +95,20 @@ static void test_same_fd(void) {
         assert_se(same_fd(b, a) == 0);
 }
 
+static void test_open_serialization_fd(void) {
+        _cleanup_close_ int fd = -1;
+
+        fd = open_serialization_fd("test");
+        assert_se(fd >= 0);
+
+        write(fd, "test\n", 5);
+}
+
 int main(int argc, char *argv[]) {
         test_close_many();
         test_close_nointr();
         test_same_fd();
+        test_open_serialization_fd();
 
         return 0;
 }