~ubuntu-branches/debian/experimental/sysvinit/experimental

« back to all changes in this revision

Viewing changes to debian/patches/21_ifdown_kfreebsd.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Petter Reinholdtsen
  • Date: 2008-08-12 16:07:50 UTC
  • Revision ID: james.westby@ubuntu.com-20080812160750-65gpyv74vh4qr69w
Tags: 2.86.ds1-61
* Fix typo in rcS(5), proberly->properly (Closes: #484233).  Thanks to
  Julien Danjou for noticing.
* Fix typo in rcS(5), maually->manually (Closes: #493680).  Thanks to
  Xr for noticing.
* Modify runlevel detection code in invoke-rc.d to notice the
  difference between runlevels 0 and 6, and the boot runlevel, to
  make it possible to use invoke-rc.d during boot (Closes: 384509).
* Make sure to call restorecon after mounting tmpfs file systems, to
  set SELinux permissions (Closes: #493679).  Patch from Russell
  Coker.
* Move responsibility of stopping the splash screen process from
  individual init.d scripts to init.d/rc.  This make sure the
  progress calculation reflect reality, and that the splash screen
  is taken down in runlevel 1 (Closes: #431560) and that it stop
  before gdm and kdm (Closes: #422922, #489734).
* Skip error message from checkfs.sh when / is read-only.  Patch
  from Mirek Slugen (Closes: #492214).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 22_ifdown_kfreebsd.dpatch mostly by Robert Millan
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Get ifdown working on kFreeBSD. (Closes: #327031)
 
6
 
 
7
@DPATCH@
 
8
diff -urNad sysvinit-2.86.ds1~/src/ifdown.c sysvinit-2.86.ds1/src/ifdown.c
 
9
--- sysvinit-2.86.ds1~/src/ifdown.c     2008-04-17 15:49:43.000000000 +0200
 
10
+++ sysvinit-2.86.ds1/src/ifdown.c      2008-04-17 15:57:16.000000000 +0200
 
11
@@ -61,10 +61,25 @@
 
12
                                continue;
 
13
                        if (strchr(ifr[i].ifr_name, ':') != NULL)
 
14
                                continue;
 
15
-                       ifr[i].ifr_flags &= ~(IFF_UP);
 
16
-                       if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {
 
17
+/* Expected in <net/if.h> according to "UNIX Network Programming". */
 
18
+#ifdef ifr_flags
 
19
+#define FLAGS ifr_flags
 
20
+#else
 
21
+/* Present on kFreeBSD, fixes bug #327031. */
 
22
+#define FLAGS ifr_flagshigh
 
23
+#endif
 
24
+                       /* Read interface flags */
 
25
+                       if (ioctl(fd, SIOCGIFFLAGS, &ifr[i]) < 0) {
 
26
                                fprintf(stderr, "ifdown: shutdown ");
 
27
                                perror(ifr[i].ifr_name);
 
28
+                               continue;
 
29
+                       }
 
30
+                       if (ifr[i].FLAGS & IFF_UP) {
 
31
+                               ifr[i].FLAGS &= ~(IFF_UP);
 
32
+                               if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {
 
33
+                                       fprintf(stderr, "ifdown: shutdown ");
 
34
+                                       perror(ifr[i].ifr_name);
 
35
+                               }
 
36
                        }
 
37
                }
 
38
        }