Commit Graph

21 Commits

Author SHA1 Message Date
Yu Watanabe f13467ec23 license: GPL-2.0+ -> GPL-2.0-or-later 2020-11-09 13:25:50 +09:00
Zbigniew Jędrzejewski-Szmek baaa35ad70 coccinelle: make use of SYNTHETIC_ERRNO
Ideally, coccinelle would strip unnecessary braces too. But I do not see any
option in coccinelle for this, so instead, I edited the patch text using
search&replace to remove the braces. Unfortunately this is not fully automatic,
in particular it didn't deal well with if-else-if-else blocks and ifdefs, so
there is an increased likelikehood be some bugs in such spots.

I also removed part of the patch that coccinelle generated for udev, where we
returns -1 for failure. This should be fixed independently.
2018-11-22 10:54:38 +01:00
Lennart Poettering 810adae9e9 tree-wide: use proper unicode © instead of (C) where we can
Let's use a proper unicode copyright symbol where we can, it's prettier.

This important patch is very important.
2018-06-14 10:20:20 +02:00
Lennart Poettering 41b9d436b2 mtd: some basic code cleanups
While looking at our exit() invocations I noticed that the mtd_probe
stuff uses 'exit(-1)' at various places, which is not really a good
idea, as exit codes of processes on Linux are supposed to be in the
range of 0…255.

This patch cleans that up a bit, and fixes a number of other things:

1. Let's always let main() exit, nothing intermediary. We generally
   don't like code that invokes exit() on its own.

2. Close the file descriptors opened.

3. Some logging for errors is added, mostly on debug level.

Please review this with extra care. As I don't have the right hardware
to test this patch I only did superficial testing.
2018-05-10 11:02:33 -07:00
Lennart Poettering 5d13a15b1d tree-wide: drop spurious newlines (#8764)
Double newlines (i.e. one empty lines) are great to structure code. But
let's avoid triple newlines (i.e. two empty lines), quadruple newlines,
quintuple newlines, …, that's just spurious whitespace.

It's an easy way to drop 121 lines of code, and keeps the coding style
of our sources a bit tigther.
2018-04-19 12:13:23 +02:00
Lennart Poettering 451cdf7830 udev: some very trivial coding style updates 2017-12-25 11:48:21 +01:00
Lennart Poettering a45d7127e7 tree-wide: use EXIT_SUCCESS/EXIT_FAILURE in exit() where we can 2017-12-25 11:48:21 +01:00
Zbigniew Jędrzejewski-Szmek e7145211c7 Add SPDX license identifiers to source files under the GPL 2017-11-19 19:08:15 +01:00
Andreas Rammhold ec2ce0c5d7
tree-wide: use `!IN_SET(..)` for `a != b && a != c && …`
The included cocci was used to generate the changes.

Thanks to @flo-wer for pointing this case out.
2017-10-02 13:09:56 +02:00
Zbigniew Jędrzejewski-Szmek 72cdb3e783 build-sys: drop automake support
v2:
- also mention m4
2017-07-18 10:04:44 -04:00
Vito Caputo 9ed794a32d tree-wide: minor formatting inconsistency cleanups 2016-02-23 14:20:34 -08:00
Lennart Poettering 0ef6f45425 tree-wide: place #pragma once at the same place everywhere
Usually, we place the #pragma once before the copyright blurb in header files,
but in a few cases we didn't. Move those around, so that we do the same thing
everywhere.
2016-02-20 22:42:29 +01:00
Thomas Hindoe Paaboel Andersen cf0fbc49e6 tree-wide: sort includes
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering 2c971c6fef build-sys: add one more Makefile symlink 2015-03-09 18:02:23 +01:00
Lennart Poettering 885fdebc13 tree-wide: use _packed_ macro instead of raw gcc __attribute__ 2015-03-09 18:02:22 +01:00
Zbigniew Jędrzejewski-Szmek c9403dced7 #pragma once here and there 2015-01-23 09:30:44 -05:00
Lennart Poettering c8a202b7d4 everywhere: always use O_CLOEXEC where it makes sense 2014-02-13 14:59:56 +01:00
Karel Zak 4561be3a64 Remove duplicate includes 2013-11-18 20:28:55 -05:00
Kay Sievers 20d83f2f43 udev: move all unconditionally installed rules to rules/ 2012-04-14 20:10:03 +02:00
Kay Sievers fc863deada udev: fix gcc warnings 2012-04-04 05:21:35 +02:00
Kay Sievers 3e2147858f move imported udev into place 2012-04-04 05:05:07 +02:00