]> git.pld-linux.org Git - packages/systemd.git/blame - sysv-symlinks-warning.patch
Patch to fix the 'Overwriting existing symlink'
[packages/systemd.git] / sysv-symlinks-warning.patch
CommitLineData
5e012f76
JK
1
2based on:
3
4From 4e5589836c9e143796c3f3d81e67ab7a9209e2b0 Mon Sep 17 00:00:00 2001
5From: Martin Pitt <martin.pitt@ubuntu.com>
6Date: Thu, 19 Feb 2015 11:06:24 +0100
7Subject: sysv-generator: fix wrong "Overwriting existing symlink" warnings
8
9Fix result testing of is_symlink() to ignore negative results, which happen if
10the file name does not exist at all. In this case we do not want a warning and
11unlink the non-existing link.
12
13https://bugs.debian.org/778700
14
15diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
16index 2091854..bd67f32 100644
17--- a/src/sysv-generator/sysv-generator.c
18+++ b/src/sysv-generator/sysv-generator.c
19@@ -166,7 +166,7 @@ static int generate_unit_file(SysvStub *s) {
20 /* We might already have a symlink with the same name from a Provides:,
21 * or from backup files like /etc/init.d/foo.bak. Real scripts always win,
22 * so remove an existing link */
23- if (is_symlink(unit)) {
24+ if (is_symlink(unit) > 0) {
25 log_warning("Overwriting existing symlink %s with real service", unit);
26 (void) unlink(unit);
27 }
28
This page took 0.029109 seconds and 4 git commands to generate.