[systemd-commits] 6 commits - LICENSE.LGPL2.1 src/gudev src/journal src/libsystemd-daemon src/libudev src/shared src/udev test/rule-syntax-check.py TODO

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Dec 17 02:42:16 PST 2012


 LICENSE.LGPL2.1                        |    1 
 TODO                                   |    2 -
 src/gudev/gudev.h                      |   11 +++-----
 src/gudev/gudevclient.c                |   12 +++------
 src/gudev/gudevclient.h                |   11 +++-----
 src/gudev/gudevdevice.c                |   12 +++------
 src/gudev/gudevdevice.h                |   11 +++-----
 src/gudev/gudevenumerator.c            |   12 +++------
 src/gudev/gudevenumerator.h            |   11 +++-----
 src/gudev/gudevenums.h                 |   11 +++-----
 src/gudev/gudevprivate.h               |   11 +++-----
 src/gudev/gudevtypes.h                 |   11 +++-----
 src/journal/journal-def.h              |   44 ++++++++++++++++-----------------
 src/libsystemd-daemon/sd-daemon.c      |    4 +--
 src/libudev/libudev-hwdb-def.h         |   16 ++++++------
 src/shared/path-util.c                 |    1 
 src/shared/socket-util.c               |    2 +
 src/shared/utf8.c                      |   13 ++++-----
 src/udev/accelerometer/accelerometer.c |   18 ++++++-------
 src/udev/keymap/keymap.c               |   18 ++++++-------
 test/rule-syntax-check.py              |   18 ++++++-------
 21 files changed, 118 insertions(+), 132 deletions(-)

New commits:
commit 8520cfa5845274f4c0312a6c3f3313195e8a5119
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Thu Dec 13 14:59:40 2012 +0100

    socket-util: added check of return value

diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index 49ea758..42ea545 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -369,6 +369,8 @@ int socket_address_print(const SocketAddress *a, char **p) {
                 if (r < 0)
                         return r;
                 r = asprintf(p, "%s %u", sfamily, a->sockaddr.nl.nl_groups);
+                if (r < 0)
+                        return -ENOMEM;
 
                 return 0;
         }

commit c9c7aef24f9750bbd51d2c13beff66473d96bf3c
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Thu Dec 13 14:59:39 2012 +0100

    path-util: set pointer to null after calling free()
    
    In cases where path_strv_canonicalize() returns NULL, strv_free() is
    called afterwards and it will call free() on pointers which were freed
    already in path_strv_canonicalize()

diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 70c8a8a..dd12d3d 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -181,6 +181,7 @@ char **path_strv_canonicalize(char **l) {
 
                 t = path_make_absolute_cwd(*s);
                 free(*s);
+                *s = NULL;
 
                 if (!t) {
                         enomem = true;

commit d1d7caeeee65c11c54ee1ce0a878024715208a75
Author: Sami Kerola <kerolasa at iki.fi>
Date:   Mon Dec 17 11:13:17 2012 +0100

    sd-daemon: fix cppcheck warnings
    
    Found with 'cppcheck --enable=all --inconclusive --std=posix' while
    working with util-linux, which has a copy of this file.
    
    [misc-utils/sd-daemon.c:363]: (style) Checking if unsigned variable \
    'length' is less than zero.
    [misc-utils/sd-daemon.c:366]: (style) Checking if unsigned variable \
    'length' is less than zero.
    
    References: http://www.spinics.net/lists/util-linux-ng/msg07031.html

diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c
index 4801d2c..80aadf7 100644
--- a/src/libsystemd-daemon/sd-daemon.c
+++ b/src/libsystemd-daemon/sd-daemon.c
@@ -364,10 +364,10 @@ _sd_export_ int sd_is_socket_unix(int fd, int type, int listening, const char *p
                 return 0;
 
         if (path) {
-                if (length <= 0)
+                if (length == 0)
                         length = strlen(path);
 
-                if (length <= 0)
+                if (length == 0)
                         /* Unnamed socket */
                         return l == offsetof(struct sockaddr_un, sun_path);
 

commit 23757887f768b0b7339239cc98aee879d9f4d87f
Author: Sami Kerola <kerolasa at iki.fi>
Date:   Sun Dec 16 22:23:23 2012 +0000

    licence: remove references to old FSF address
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=57206

diff --git a/LICENSE.LGPL2.1 b/LICENSE.LGPL2.1
index 5cbfcb5..4362b49 100644
--- a/LICENSE.LGPL2.1
+++ b/LICENSE.LGPL2.1
@@ -1,4 +1,3 @@
-
                   GNU LESSER GENERAL PUBLIC LICENSE
                        Version 2.1, February 1999
 
diff --git a/TODO b/TODO
index 9ddfb5c..ff63dcd 100644
--- a/TODO
+++ b/TODO
@@ -195,8 +195,6 @@ Features:
 * document that deps in [Unit] sections ignore Alias= fileds in
   [Install] units of other units, unless those units are disabled
 
-* need to update LGPL2.1 text to newest version (with updated FSF address)
-
 * systemctl: when powering down/suspending check for inhibitors, and warn.
 
 * instantiated [Install] for target units
diff --git a/src/gudev/gudev.h b/src/gudev/gudev.h
index 6ae01f2..1dc42b1 100644
--- a/src/gudev/gudev.h
+++ b/src/gudev/gudev.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #ifndef __G_UDEV_H__
diff --git a/src/gudev/gudevclient.c b/src/gudev/gudevclient.c
index 2b94102..a151b50 100644
--- a/src/gudev/gudevclient.c
+++ b/src/gudev/gudevclient.c
@@ -3,20 +3,18 @@
  * Copyright (C) 2008-2010 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Library General Public License for more details.
  *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/gudev/gudevclient.h b/src/gudev/gudevclient.h
index b425d03..23bfce6 100644
--- a/src/gudev/gudevclient.h
+++ b/src/gudev/gudevclient.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/gudev/gudevdevice.c b/src/gudev/gudevdevice.c
index 62a26f9..6c9e0f5 100644
--- a/src/gudev/gudevdevice.c
+++ b/src/gudev/gudevdevice.c
@@ -3,20 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Library General Public License for more details.
  *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/gudev/gudevdevice.h b/src/gudev/gudevdevice.h
index d4873ba..457b961 100644
--- a/src/gudev/gudevdevice.h
+++ b/src/gudev/gudevdevice.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/gudev/gudevenumerator.c b/src/gudev/gudevenumerator.c
index db09074..1fb3098 100644
--- a/src/gudev/gudevenumerator.c
+++ b/src/gudev/gudevenumerator.c
@@ -3,20 +3,18 @@
  * Copyright (C) 2008-2010 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Library General Public License for more details.
  *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #ifdef HAVE_CONFIG_H
diff --git a/src/gudev/gudevenumerator.h b/src/gudev/gudevenumerator.h
index 3fddccf..e1dbcf1 100644
--- a/src/gudev/gudevenumerator.h
+++ b/src/gudev/gudevenumerator.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008-2010 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/gudev/gudevenums.h b/src/gudev/gudevenums.h
index c3a0aa8..467e93b 100644
--- a/src/gudev/gudevenums.h
+++ b/src/gudev/gudevenums.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/gudev/gudevprivate.h b/src/gudev/gudevprivate.h
index 8866f52..52e272b 100644
--- a/src/gudev/gudevprivate.h
+++ b/src/gudev/gudevprivate.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/gudev/gudevtypes.h b/src/gudev/gudevtypes.h
index 8884827..e2f688f 100644
--- a/src/gudev/gudevtypes.h
+++ b/src/gudev/gudevtypes.h
@@ -3,19 +3,18 @@
  * Copyright (C) 2008 David Zeuthen <davidz at redhat.com>
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
diff --git a/src/shared/utf8.c b/src/shared/utf8.c
index 5f9f3c6..62e2803 100644
--- a/src/shared/utf8.c
+++ b/src/shared/utf8.c
@@ -28,19 +28,18 @@
  * Copyright (C) 2000 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
+ * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
  * version 2 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
- * Lesser General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include <errno.h>
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index 67fed27..21f5193 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -29,19 +29,19 @@
  *   Timo Rongas <ext-timo.2.rongas at nokia.com>
  *   Lihan Guo <lihan.guo at digia.com>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with keymap; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c
index 939407f..27aaf6b 100644
--- a/src/udev/keymap/keymap.c
+++ b/src/udev/keymap/keymap.c
@@ -7,19 +7,19 @@
  * Copyright (C) 2006, Lennart Poettering
  * Copyright (C) 2009, Canonical Ltd.
  *
- * keymap is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * keymap is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with keymap; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
diff --git a/test/rule-syntax-check.py b/test/rule-syntax-check.py
index 4b602a9..b18f878 100755
--- a/test/rule-syntax-check.py
+++ b/test/rule-syntax-check.py
@@ -4,19 +4,19 @@
 # (C) 2010 Canonical Ltd.
 # Author: Martin Pitt <martin.pitt at ubuntu.com>
 #
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import re
 import sys

commit 80701564cdd020318064f55c3f7c447df0b2cd24
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Dec 17 11:38:47 2012 +0100

    journal: move _packed_ attribute to the end
    
    GCC manual states that "For an enum, struct or union type, you may
    specify attributes either between the enum, struct or union tag and
    the name of the type, or just past the closing curly brace of the
    definition. The former syntax is preferred." This means that the
    attribute should not be located before 'struct'. Putting it between
    'struct' and the name seems cluttered. Putting it at the end seems
    most readable.
    
    This avoids clang warnings.

diff --git a/src/journal/journal-def.h b/src/journal/journal-def.h
index ac5611c..7e407a4 100644
--- a/src/journal/journal-def.h
+++ b/src/journal/journal-def.h
@@ -69,15 +69,15 @@ enum {
         OBJECT_COMPRESSED = 1
 };
 
-_packed_ struct ObjectHeader {
+struct ObjectHeader {
         uint8_t type;
         uint8_t flags;
         uint8_t reserved[6];
         le64_t size;
         uint8_t payload[];
-};
+} _packed_;
 
-_packed_ struct DataObject {
+struct DataObject {
         ObjectHeader object;
         le64_t hash;
         le64_t next_hash_offset;
@@ -86,22 +86,22 @@ _packed_ struct DataObject {
         le64_t entry_array_offset;
         le64_t n_entries;
         uint8_t payload[];
-};
+} _packed_;
 
-_packed_ struct FieldObject {
+struct FieldObject {
         ObjectHeader object;
         le64_t hash;
         le64_t next_hash_offset;
         le64_t head_data_offset;
         uint8_t payload[];
-};
+} _packed_;
 
-_packed_ struct EntryItem {
+struct EntryItem {
         le64_t object_offset;
         le64_t hash;
-};
+} _packed_;
 
-_packed_ struct EntryObject {
+struct EntryObject {
         ObjectHeader object;
         le64_t seqnum;
         le64_t realtime;
@@ -109,32 +109,32 @@ _packed_ struct EntryObject {
         sd_id128_t boot_id;
         le64_t xor_hash;
         EntryItem items[];
-};
+} _packed_;
 
-_packed_ struct HashItem {
+struct HashItem {
         le64_t head_hash_offset;
         le64_t tail_hash_offset;
-};
+} _packed_;
 
-_packed_ struct HashTableObject {
+struct HashTableObject {
         ObjectHeader object;
         HashItem items[];
-};
+} _packed_;
 
-_packed_ struct EntryArrayObject {
+struct EntryArrayObject {
         ObjectHeader object;
         le64_t next_entry_array_offset;
         le64_t items[];
-};
+} _packed_;
 
 #define TAG_LENGTH (256/8)
 
-_packed_ struct TagObject {
+struct TagObject {
         ObjectHeader object;
         le64_t seqnum;
         le64_t epoch;
         uint8_t tag[TAG_LENGTH]; /* SHA-256 HMAC */
-};
+} _packed_;
 
 union Object {
         ObjectHeader object;
@@ -164,7 +164,7 @@ enum {
 
 #define HEADER_SIGNATURE ((char[]) { 'L', 'P', 'K', 'S', 'H', 'H', 'R', 'H' })
 
-_packed_ struct Header {
+struct Header {
         uint8_t signature[8]; /* "LPKSHHRH" */
         le32_t compatible_flags;
         le32_t incompatible_flags;
@@ -197,11 +197,11 @@ _packed_ struct Header {
         le64_t n_entry_arrays;
 
         /* Size: 224 */
-};
+} _packed_;
 
 #define FSS_HEADER_SIGNATURE ((char[]) { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' })
 
-_packed_ struct FSSHeader {
+struct FSSHeader {
         uint8_t signature[8]; /* "KSHHRHLP" */
         le32_t compatible_flags;
         le32_t incompatible_flags;
@@ -213,4 +213,4 @@ _packed_ struct FSSHeader {
         le16_t fsprg_secpar;
         le16_t reserved[3];
         le64_t fsprg_state_size;
-};
+} _packed_;

commit e683136da1b2f0961e19b35634bea7f31ee310ac
Author: Richard Yao <ryao at gentoo.org>
Date:   Sun Nov 18 14:55:10 2012 -0500

    Fix "attribute 'packed' is ignored" warnings when using Clang
    
    Clang 3.1 warned that "attribute 'packed' is ignored". This stems from
    placing "__attribute__ ((packed))" at the start of structure
    declarations when common practice is to place it at the end.
    
    Signed-off-by: Richard Yao <ryao at gentoo.org>

diff --git a/src/libudev/libudev-hwdb-def.h b/src/libudev/libudev-hwdb-def.h
index e167e28..b76a13f 100644
--- a/src/libudev/libudev-hwdb-def.h
+++ b/src/libudev/libudev-hwdb-def.h
@@ -25,7 +25,7 @@
 #define HWDB_SIG { 'K', 'S', 'L', 'P', 'H', 'H', 'R', 'H' }
 
 /* on-disk trie objects */
-_packed_ struct trie_header_f {
+struct trie_header_f {
         uint8_t signature[8];
 
         /* version of tool which created the file */
@@ -44,9 +44,9 @@ _packed_ struct trie_header_f {
         /* size of the nodes and string section */
         le64_t nodes_len;
         le64_t strings_len;
-};
+} _packed_;
 
-_packed_ struct trie_node_f {
+struct trie_node_f {
         /* prefix of lookup string, shared by all children  */
         le64_t prefix_off;
         /* size of children entry array appended to the node */
@@ -54,21 +54,21 @@ _packed_ struct trie_node_f {
         uint8_t padding[7];
         /* size of value entry array appended to the node */
         le64_t values_count;
-};
+} _packed_;
 
 /* array of child entries, follows directly the node record */
-_packed_ struct trie_child_entry_f {
+struct trie_child_entry_f {
         /* index of the child node */
         uint8_t c;
         uint8_t padding[7];
         /* offset of the child node */
         le64_t child_off;
-};
+} _packed_;
 
 /* array of value entries, follows directly the node record/child array */
-_packed_ struct trie_value_entry_f {
+struct trie_value_entry_f {
         le64_t key_off;
         le64_t value_off;
-};
+} _packed_;
 
 #endif



More information about the systemd-commits mailing list