summaryrefslogtreecommitdiff
path: root/src/login/logind-button.c
Commit message (Collapse)AuthorAge
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* [4/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* tree-wide: drop redundant if checks before safe_close()Lennart Poettering2017-03-29
| | | | | | | | | | | Replace this: if (fd >= 0) safe_close(fd); by this: safe_close(fd);
* tree-wide: make more code use safe_close()Lennart Poettering2017-03-29
| | | | | | | | | | | Replace this: close(fd); fd = -1; write this: fd = safe_close(fd);
* logind: rework display counting when detecting whether the system is dockedLennart Poettering2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we'd just count connected displays, and if there was 2 or more we assumed a "docked" state. With this change we now: - Only count external displays, ignore internal ones (which we detect by checking the connector name against a whitelist of known external plug types) - We ignore connectors which are explicitly disabled - We then compare the count with >= 1 rather than >= 2 as before This new logic has the benefit that systems that disconnect the internal display when the lid is closed are better supported. Also, explicitly disabled ports do not confuse the algorithm anymore. This new algorithm has been suggested here: http://lists.freedesktop.org/archives/intel-gfx/2015-June/068821.html This also makes two functions static, that are not used outside of their .c files.
* logind: cast close() call to (void)Lennart Poettering2017-03-14
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | 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.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* log: fix order of log_unit_struct() to match other logging callsLennart Poettering2014-11-28
| | | | | Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
* logind: add HandleLidSwitchDocked= option to logind.conf + documentationBen Wolsieffer2014-08-26
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=82485
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-18
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* logind: detect whether the system is docked, and if it is inhibit lid switch ↵Lennart Poettering2014-02-24
| | | | | | | processing This should make operation nicer with docking stations, but will not cover anything that does not implement SW_DOCK.
* logind: when we wake up from suspend and the lid is still closed, go to ↵Lennart Poettering2014-02-21
| | | | | | | | | | | | | | | | | | | sleep immediately again This is quite useful on laptops such as the Lenovo Yoga, where the power button is placed on the front side of the laptop and can be pressed by accident even if the lid is closed. This reworks a bit of the logind logic to repeatedly try to suspend the system as long as a lid is closed. We use the new "post" event source for this, so that we don't keep things busy. This also adds some code to check the lid status on boot, so that a powered-off machine that is accidentaly powered on goes into suspend immediately. Yay! From now on I can put my Yoga safely in my backpack without fearing that it might turn itself on and drain the battery.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* event: be more conservative when returning errors from event handler callbacksLennart Poettering2013-12-13
| | | | | We really should return errors from event handlers if we have a continous problem and don't know any other solution.
* button: don't exit if we cannot handle a button pressLennart Poettering2013-11-10
|
* logind: port logind to libsystemd-busLennart Poettering2013-11-05
|
* logind: don't hit an assert if an close() on an input device fd fails with ↵Lennart Poettering2013-03-07
| | | | | | ENODEV because the device is gone https://bugzilla.redhat.com/show_bug.cgi?id=907890
* logind: add MESSAGE_IDs to interesting eventsZbigniew Jędrzejewski-Szmek2013-01-27
|
* logind: add support for automatic suspend/hibernate/shutdown on idleLennart Poettering2012-12-24
|
* logind: unify all session lock loopLennart Poettering2012-10-30
|
* login: trivial grammar fixZbigniew Jędrzejewski-Szmek2012-10-28
|
* logind: add 'lock' as possible choice for handling hw keysLennart Poettering2012-10-28
|
* logind: support for hybrid sleep (i.e. suspend+hibernate at the same time)Lennart Poettering2012-10-28
|
* logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=Lennart Poettering2012-09-21
| | | | | The kernel and X11 distuingish these two, and Thinkpad keys have both, hence we really should distinguish them too.
* logind: allow users to override their own suspend/sleep inhibitorsLennart Poettering2012-09-21
|
* logind: if a lid-switch lock was taken while the lid was closed, recheck lid ↵Lennart Poettering2012-09-19
| | | | status when the lock is released
* logind: rework power key/suspend key/lid switch handlingLennart Poettering2012-09-19
| | | | | | | | http://lists.freedesktop.org/archives/systemd-devel/2012-September/006604.html https://bugzilla.gnome.org/show_bug.cgi?id=680689 This changes the meaning of the HandlePowerKey=/HandleSleepKey=/HandleLidSwitch= setting of logind.conf
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-26
| | | | | | 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-25
| | | | | | | | 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
* logind: rework button setting semanticsLennart Poettering2012-05-30
| | | | | If a graphical session without full DE that handles power/suspend events is used this can now be controlled by logind instead, optionally.
* logind: add missing filesLennart Poettering2012-05-30