]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/login/test-inhibit.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / login / test-inhibit.c
index d0727ff7c7e760b98eb381b947f30989c203f34f..ad4700f328f4d18194b59d95d4d47dbd197cf338 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -29,8 +28,8 @@
 #include "util.h"
 
 static int inhibit(sd_bus *bus, const char *what) {
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
+        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *who = "Test Tool", *reason = "Just because!", *mode = "block";
         int fd;
         int r;
@@ -53,8 +52,8 @@ static int inhibit(sd_bus *bus, const char *what) {
 }
 
 static void print_inhibitors(sd_bus *bus) {
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
-        _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+        _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
+        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
         const char *what, *who, *why, *mode;
         uint32_t uid, pid;
         unsigned n = 0;
@@ -85,7 +84,7 @@ static void print_inhibitors(sd_bus *bus) {
 }
 
 int main(int argc, char*argv[]) {
-        _cleanup_bus_unref_ sd_bus *bus = NULL;
+        _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
         int fd1, fd2;
         int r;