summaryrefslogtreecommitdiff
path: root/src/udev/scsi_id/scsi_id.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: drop string.h when string-util.h or friends are includedYu Watanabe2019-11-041-1/+0
|
* udev: drop unnecessary bracketsYu Watanabe2019-04-301-4/+2
| | | | Follow-up for ed0cb346821972ec2c505ee11ed3d383aba6256e.
* tree-wide: code improvements suggested by CoccinelleFrantisek Sumsal2019-04-301-4/+6
|
* tree-wide: replace explicit NULL checks with their shorter variantsFrantisek Sumsal2019-04-281-3/+3
| | | | Done by coccinelle/equals-null.cocci
* meson: generate version tag from gitZbigniew Jędrzejewski-Szmek2018-12-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ build/systemctl --version systemd 239-3555-g6178cbb5b5 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid $ git tag v240 -m 'v240' $ ninja -C build ninja: Entering directory `build' [76/76] Linking target fuzz-unit-file. $ build/systemctl --version systemd 240 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN +PCRE2 default-hierarchy=hybrid This is very useful during development, because a precise version string is embedded in the build product and displayed during boot, so we don't have to guess answers for questions like "did I just boot the latest version or the one from before?". This change creates an overhead for "noop" builds. On my laptop, 'ninja -C build' that does nothing goes from 0.1 to 0.5 s. It would be nice to avoid this, but I think that <1 s is still acceptable. Fixes #7183. PACKAGE_VERSION is renamed to GIT_VERSION, to make it obvious that this is the more dynamically changing version string. Why save to a file? It would be easy to generate the version tag using run_command(), but we want to go through a file so that stuff gets rebuilt when this file changes. If we just defined an variable in meson, ninja wouldn't know it needs to rebuild things.
* udev/scsi_id: fix buffer lengthYu Watanabe2018-11-211-6/+6
|
* libudev-list: move libudev-list related definitions to libudev-list-internal.hYu Watanabe2018-11-201-1/+2
| | | | | This also rename libudev-private.h to libudev-util.h, and cleanups several unnecessary headers from udev.h and libudev-util.h
* udev/scsi_id: coding style fixesYu Watanabe2018-09-101-6/+3
|
* udev/scsi_id: drop unused udev structYu Watanabe2018-09-101-31/+16
|
* udev: move udev cleanup functions from udev-util.h to udev.hYu Watanabe2018-08-231-0/+1
|
* tree-wide: drop empty lines in commentsYu Watanabe2018-07-231-1/+0
|
* Drop more license boilerplateZbigniew Jędrzejewski-Szmek2018-06-141-12/+0
| | | | | | | | $ git grep -e 'This program is free software' -l |grep -v LICENSE | \ xargs perl -i -0pe 's/ \* This program.*?for more details.\s*\*\n( \* You should have.*licenses.>.\n)?//gms' For some reason they were missed previously. All those files seem to have proper SDPX tags.
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-141-2/+2
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* scsi_id: use _cleanup_free_ on buffer allocated by get_file_optionsFilipe Brandenburger2018-06-081-3/+2
| | | | | | | | | | This simplifies the code a bit and hopefully fixes Coverity finding CID 1382966. There was not actually a resource leak here (Coverity seemed to be confused by thinking log_oom() could actually return 0), but the fix doesn't hurt and should make this code more resilient to future refactorings. Tested: builds fine, manually called scsi_id, seems to work ok.
* tree-wide: drop redundant _cleanup_ macros (#8810)Lennart Poettering2018-04-251-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
* udev: use startswith() instead of the combination of strneq() and strlen() ↵Yu Watanabe2018-03-161-3/+2
| | | | (#8459)
* tree-wide: use EXIT_SUCCESS/EXIT_FAILURE in exit() where we canLennart Poettering2017-12-251-3/+3
|
* Add SPDX license identifiers to source files under the GPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
|
* scsi_id: add missing options to getopt_long() (#6501)Jan Synacek2017-08-021-1/+1
|
* Rip out setting of the log level from udev_new and put it in a new functionZbigniew Jędrzejewski-Szmek2017-05-071-0/+2
| | | | | | | | This function is internal to systemd code, so external users of libudev will not see those log messages. I think this is better. If we want to allow that, the function could be put in libudev and exported. v2: check that the string is more than one char before stripping quotes
* tree-wide: standardize on $(PACKAGE_VERSION) for the version stringZbigniew Jędrzejewski-Szmek2017-04-041-1/+1
| | | | | | We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents. $(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and drop the other define.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* udev: add emacs header lineZbigniew Jędrzejewski-Szmek2015-12-071-0/+2
| | | | | Otherwise emacs wants to use 2-space indentation and other attrocities.
* tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen2015-11-171-1/+2
|
* tree-wide: sort includesThomas Hindoe Paaboel Andersen2015-11-161-2/+1
| | | | Sort the includes accoding to the new coding style.
* util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering2015-10-251-0/+1
| | | | | There are more than enough to deserve their own .c file, hence move them over.
* util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering2015-10-241-8/+10
| | | | | | | | | | | | | | string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
* tree-wide: replace while(1) by for(;;) everywhereLennart Poettering2015-09-091-1/+1
| | | | Another Coccinelle script.
* tree-wide: update empty-if coccinelle script to cover empty-while and moreLennart Poettering2015-09-091-8/+5
| | | | Let's also clean up single-line while and for blocks.
* udevadm,..: make --help output of udev tools more like the output of the ↵Lennart Poettering2015-01-051-13/+15
| | | | various other tools
* udev: improve help/usage for some more programsRobert Milasan2015-01-011-1/+1
|
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-281-1/+1
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* udev: switch to systemd logging functionsKay Sievers2014-11-131-11/+0
|
* scsi_id: fix usage spellingJoe Lawrence2014-11-011-2/+2
| | | | s/threat/treat/g
* udev: never bypass our own logging framework and call vsyslog() directly ↵Lennart Poettering2014-08-111-5/+8
| | | | from udev tools
* Remove dead lines in various placesZbigniew Jędrzejewski-Szmek2014-02-241-1/+0
| | | | | | As pointed-out by clang -Wunreachable-code. No behaviour changes.
* log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering2013-12-241-8/+8
| | | | including it in the log strings
* udevadm,scsi_id: add short options to help strings and to the man pageZbigniew Jędrzejewski-Szmek2013-12-181-14/+19
| | | | Also clean things up a bit here and there.
* scsi_id: cleanupZbigniew Jędrzejewski-Szmek2013-12-181-75/+67
| | | | | | | | | | Remove -i option which would case exit(1) to happen. Remove some unused code. Convert to bool where appropriate. Simplify things a bit. Always free everything. https://bugzilla.redhat.com/show_bug.cgi?id=1043304
* Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen2013-12-141-0/+1
| | | | | | | | | | | Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
* tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch2013-11-261-1/+1
| | | | | | Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
* use streq instead of strcmpThomas Hindoe Paaboel Andersen2013-02-131-6/+6
|
* util: introduce strcaseeq/strncaseeqThomas Hindoe Paaboel Andersen2013-02-131-3/+3
|
* use strneq instead of strncmpThomas Hindoe Paaboel Andersen2013-02-131-4/+4
|
* udev: move string copy functions to shared/Kay Sievers2013-01-091-4/+4
|
* udev: get rid of SYSCONFDIRKay Sievers2012-10-281-1/+1
|
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-261-7/+5
| | | | | | also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-251-2/+2
| | | | | | | | glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
* udev: add some O_CLOEXECKay Sievers2012-07-051-1/+1
|
* udev: switch to systemd logging functionsKay Sievers2012-04-081-35/+14
|