| conf-parser.h | | conf-parser.h | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 98 | |
| bool relaxed, | | bool relaxed, | |
| void *userdata); | | void *userdata); | |
| | | | |
| /* Generic parsers */ | | /* Generic parsers */ | |
| int config_parse_int(const char *filename, unsigned line, const char *secti
on, const char *lvalue, int ltype, const char *rvalue, void *data, void *us
erdata); | | int config_parse_int(const char *filename, unsigned line, const char *secti
on, const char *lvalue, int ltype, const char *rvalue, void *data, void *us
erdata); | |
| int config_parse_unsigned(const char *filename, unsigned line, const char *
section, const char *lvalue, int ltype, const char *rvalue, void *data, voi
d *userdata); | | int config_parse_unsigned(const char *filename, unsigned line, const char *
section, const char *lvalue, int ltype, const char *rvalue, void *data, voi
d *userdata); | |
| int config_parse_long(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_long(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_uint64(const char *filename, unsigned line, const char *se
ction, const char *lvalue, int ltype, const char *rvalue, void *data, void
*userdata); | | int config_parse_uint64(const char *filename, unsigned line, const char *se
ction, const char *lvalue, int ltype, const char *rvalue, void *data, void
*userdata); | |
| int config_parse_size(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_size(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_bool(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_bool(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
|
| | | int config_parse_tristate(const char *filename, unsigned line, const char *
section, const char *lvalue, int ltype, const char *rvalue, void *data, voi
d *userdata); | |
| int config_parse_string(const char *filename, unsigned line, const char *se
ction, const char *lvalue, int ltype, const char *rvalue, void *data, void
*userdata); | | int config_parse_string(const char *filename, unsigned line, const char *se
ction, const char *lvalue, int ltype, const char *rvalue, void *data, void
*userdata); | |
| int config_parse_path(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_path(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_strv(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_strv(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_path_strv(const char *filename, unsigned line, const char
*section, const char *lvalue, int ltype, const char *rvalue, void *data, vo
id *userdata); | | int config_parse_path_strv(const char *filename, unsigned line, const char
*section, const char *lvalue, int ltype, const char *rvalue, void *data, vo
id *userdata); | |
| int config_parse_usec(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_usec(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_mode(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | | int config_parse_mode(const char *filename, unsigned line, const char *sect
ion, const char *lvalue, int ltype, const char *rvalue, void *data, void *u
serdata); | |
| int config_parse_bytes(const char *filename, unsigned line, const char *sec
tion, const char *lvalue, int ltype, const char *rvalue, void *data, void *
userdata); | | int config_parse_bytes(const char *filename, unsigned line, const char *sec
tion, const char *lvalue, int ltype, const char *rvalue, void *data, void *
userdata); | |
| | | | |
| #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | | #define DEFINE_CONFIG_PARSE_ENUM(function,name,type,msg) \ | |
| int function( \ | | int function( \ | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 1 lines changed or added | |
|
| dbus-common.h | | dbus-common.h | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 99 | |
| | | | |
| int bus_connect_system_ssh(const char *user, const char *host, DBusConnecti
on **_bus, DBusError *error); | | int bus_connect_system_ssh(const char *user, const char *host, DBusConnecti
on **_bus, DBusError *error); | |
| int bus_connect_system_polkit(DBusConnection **_bus, DBusError *error); | | int bus_connect_system_polkit(DBusConnection **_bus, DBusError *error); | |
| | | | |
| const char *bus_error_message(const DBusError *error); | | const char *bus_error_message(const DBusError *error); | |
| | | | |
| typedef int (*BusPropertyCallback)(DBusMessageIter *iter, const char *prope
rty, void *data); | | typedef int (*BusPropertyCallback)(DBusMessageIter *iter, const char *prope
rty, void *data); | |
| typedef int (*BusPropertySetCallback)(DBusMessageIter *iter, const char *pr
operty); | | typedef int (*BusPropertySetCallback)(DBusMessageIter *iter, const char *pr
operty); | |
| | | | |
| typedef struct BusProperty { | | typedef struct BusProperty { | |
|
| const char *interface; /* interface of the property */ | | | |
| const char *property; /* name of the property */ | | const char *property; /* name of the property */ | |
| BusPropertyCallback append; /* Function that is called to seri
alize this property */ | | BusPropertyCallback append; /* Function that is called to seri
alize this property */ | |
| const char *signature; | | const char *signature; | |
|
| const void *data; /* The data of this property */ | | const uint16_t offset; /* Offset from BusBoundProperties: | |
| | | :base address to the property data. | |
| | | * uint16_t is sufficient, because | |
| | | we have no structs too big. | |
| | | * -Werror=overflow will catch it | |
| | | if this does not hold. */ | |
| | | bool indirect; /* data is indirect, ie. not base+ | |
| | | offset, but *(base+offset) */ | |
| BusPropertySetCallback set; /* Optional: Function that is call
ed to set this property */ | | BusPropertySetCallback set; /* Optional: Function that is call
ed to set this property */ | |
| } BusProperty; | | } BusProperty; | |
| | | | |
|
| | | typedef struct BusBoundProperties { | |
| | | const char *interface; /* interface of the properties */ | |
| | | const BusProperty *properties; /* array of properties, ended by a | |
| | | NULL-filled element */ | |
| | | const void *const base; /* base pointer to which the offse | |
| | | t must be added to reach data */ | |
| | | } BusBoundProperties; | |
| | | | |
| DBusHandlerResult bus_send_error_reply( | | DBusHandlerResult bus_send_error_reply( | |
| DBusConnection *c, | | DBusConnection *c, | |
| DBusMessage *message, | | DBusMessage *message, | |
| DBusError *bus_error, | | DBusError *bus_error, | |
| int error); | | int error); | |
| | | | |
| DBusHandlerResult bus_default_message_handler( | | DBusHandlerResult bus_default_message_handler( | |
| DBusConnection *c, | | DBusConnection *c, | |
| DBusMessage *message, | | DBusMessage *message, | |
| const char *introspection, | | const char *introspection, | |
| const char *interfaces, | | const char *interfaces, | |
|
| const BusProperty *properties); | | const BusBoundProperties *bound_properties); | |
| | | | |
| int bus_property_append_string(DBusMessageIter *i, const char *property, vo
id *data); | | int bus_property_append_string(DBusMessageIter *i, const char *property, vo
id *data); | |
| int bus_property_append_strv(DBusMessageIter *i, const char *property, void
*data); | | int bus_property_append_strv(DBusMessageIter *i, const char *property, void
*data); | |
| int bus_property_append_bool(DBusMessageIter *i, const char *property, void
*data); | | int bus_property_append_bool(DBusMessageIter *i, const char *property, void
*data); | |
|
| | | int bus_property_append_tristate_false(DBusMessageIter *i, const char *prop
erty, void *data); | |
| int bus_property_append_int32(DBusMessageIter *i, const char *property, voi
d *data); | | int bus_property_append_int32(DBusMessageIter *i, const char *property, voi
d *data); | |
| int bus_property_append_uint32(DBusMessageIter *i, const char *property, vo
id *data); | | int bus_property_append_uint32(DBusMessageIter *i, const char *property, vo
id *data); | |
| int bus_property_append_uint64(DBusMessageIter *i, const char *property, vo
id *data); | | int bus_property_append_uint64(DBusMessageIter *i, const char *property, vo
id *data); | |
| int bus_property_append_size(DBusMessageIter *i, const char *property, void
*data); | | int bus_property_append_size(DBusMessageIter *i, const char *property, void
*data); | |
| int bus_property_append_ul(DBusMessageIter *i, const char *property, void *
data); | | int bus_property_append_ul(DBusMessageIter *i, const char *property, void *
data); | |
| int bus_property_append_long(DBusMessageIter *i, const char *property, void
*data); | | int bus_property_append_long(DBusMessageIter *i, const char *property, void
*data); | |
| | | | |
| #define bus_property_append_int bus_property_append_int32 | | #define bus_property_append_int bus_property_append_int32 | |
| #define bus_property_append_pid bus_property_append_uint32 | | #define bus_property_append_pid bus_property_append_uint32 | |
| #define bus_property_append_uid bus_property_append_uint32 | | #define bus_property_append_uid bus_property_append_uint32 | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 18 lines changed or added | |
|
| dbus-execute.h | | dbus-execute.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| General Public License for more details. | | General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <dbus/dbus.h> | | #include <dbus/dbus.h> | |
| | | | |
| #include "manager.h" | | #include "manager.h" | |
|
| | | #include "dbus-common.h" | |
| | | | |
| #define BUS_EXEC_STATUS_INTERFACE(prefix) \ | | #define BUS_EXEC_STATUS_INTERFACE(prefix) \ | |
| " <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\"
read\"/>\n" \ | | " <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\"
read\"/>\n" \ | |
| " <property name=\"" prefix "StartTimestampMonotonic\" type=\"t\"
access=\"read\"/>\n" \ | | " <property name=\"" prefix "StartTimestampMonotonic\" type=\"t\"
access=\"read\"/>\n" \ | |
| " <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"r
ead\"/>\n" \ | | " <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"r
ead\"/>\n" \ | |
| " <property name=\"" prefix "ExitTimestampMonotonic\" type=\"t\" a
ccess=\"read\"/>\n" \ | | " <property name=\"" prefix "ExitTimestampMonotonic\" type=\"t\" a
ccess=\"read\"/>\n" \ | |
| " <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n"
\ | | " <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n"
\ | |
| " <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n
" \ | | " <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n
" \ | |
| " <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/>
\n" | | " <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/>
\n" | |
| | | | |
| | | | |
| skipping to change at line 96 | | skipping to change at line 97 | |
| " <property name=\"ReadWriteDirectories\" type=\"as\" access=\"rea
d\"/>\n" \ | | " <property name=\"ReadWriteDirectories\" type=\"as\" access=\"rea
d\"/>\n" \ | |
| " <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read
\"/>\n" \ | | " <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read
\"/>\n" \ | |
| " <property name=\"InaccessibleDirectories\" type=\"as\" access=\"
read\"/>\n" \ | | " <property name=\"InaccessibleDirectories\" type=\"as\" access=\"
read\"/>\n" \ | |
| " <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \ | | " <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \ | |
| " <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \ | | " <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \ | |
| " <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/>
\n" \ | | " <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/>
\n" \ | |
| " <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \ | | " <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \ | |
| " <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \ | | " <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \ | |
| " <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n
" \ | | " <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n
" \ | |
| " <property name=\"ControlGroupModify\" type=\"b\" access=\"read\"
/>\n" \ | | " <property name=\"ControlGroupModify\" type=\"b\" access=\"read\"
/>\n" \ | |
|
| | | " <property name=\"ControlGroupPersistent\" type=\"b\" access=\"re
ad\"/>\n" \ | |
| " <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n
" | | " <property name=\"PrivateNetwork\" type=\"b\" access=\"read\"/>\n
" | |
| | | | |
| #define BUS_EXEC_COMMAND_INTERFACE(name) \ | | #define BUS_EXEC_COMMAND_INTERFACE(name) \ | |
| " <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\
"/>\n" | | " <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\
"/>\n" | |
| | | | |
|
| #define BUS_EXEC_CONTEXT_PROPERTIES(interface, context) \ | | extern const BusProperty bus_exec_context_properties[]; | |
| { interface, "Environment", bus_property_append_s | | | |
| trv, "as", (context).environment }, \ | | | |
| { interface, "EnvironmentFiles", bus_execute_append_en | | | |
| v_files, "a(sb)", (context).environment_files }, \ | | | |
| { interface, "UMask", bus_property_append_m | | | |
| ode, "u", &(context).umask }, \ | | | |
| { interface, "LimitCPU", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitFSIZE", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitDATA", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitSTACK", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitCORE", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitRSS", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitNOFILE", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitAS", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitNPROC", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitMEMLOCK", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitLOCKS", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitSIGPENDING", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitMSGQUEUE", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitNICE", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitRTPRIO", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "LimitRTTIME", bus_execute_append_rl | | | |
| imits, "t", &(context) }, \ | | | |
| { interface, "WorkingDirectory", bus_property_append_s | | | |
| tring, "s", (context).working_directory }, \ | | | |
| { interface, "RootDirectory", bus_property_append_s | | | |
| tring, "s", (context).root_directory }, \ | | | |
| { interface, "OOMScoreAdjust", bus_execute_append_oo | | | |
| m_score_adjust, "i", &(context) }, \ | | | |
| { interface, "Nice", bus_execute_append_ni | | | |
| ce, "i", &(context) }, \ | | | |
| { interface, "IOScheduling", bus_execute_append_io | | | |
| prio, "i", &(context) }, \ | | | |
| { interface, "CPUSchedulingPolicy", bus_execute_append_cp | | | |
| u_sched_policy, "i", &(context) }, \ | | | |
| { interface, "CPUSchedulingPriority", bus_execute_append_cp | | | |
| u_sched_priority, "i", &(context) }, \ | | | |
| { interface, "CPUAffinity", bus_execute_append_af | | | |
| finity,"ay", &(context) }, \ | | | |
| { interface, "TimerSlackNSec", bus_execute_append_ti | | | |
| mer_slack_nsec, "t", &(context) }, \ | | | |
| { interface, "CPUSchedulingResetOnFork", bus_property_append_b | | | |
| ool, "b", &(context).cpu_sched_reset_on_fork }, \ | | | |
| { interface, "NonBlocking", bus_property_append_b | | | |
| ool, "b", &(context).non_blocking }, \ | | | |
| { interface, "StandardInput", bus_execute_append_in | | | |
| put, "s", &(context).std_input }, \ | | | |
| { interface, "StandardOutput", bus_execute_append_ou | | | |
| tput, "s", &(context).std_output }, \ | | | |
| { interface, "StandardError", bus_execute_append_ou | | | |
| tput, "s", &(context).std_error }, \ | | | |
| { interface, "TTYPath", bus_property_append_s | | | |
| tring, "s", (context).tty_path }, \ | | | |
| { interface, "TTYReset", bus_property_append_b | | | |
| ool, "b", &(context).tty_reset }, \ | | | |
| { interface, "TTYVHangup", bus_property_append_b | | | |
| ool, "b", &(context).tty_vhangup }, \ | | | |
| { interface, "TTYVTDisallocate", bus_property_append_b | | | |
| ool, "b", &(context).tty_vt_disallocate }, \ | | | |
| { interface, "SyslogPriority", bus_property_append_i | | | |
| nt, "i", &(context).syslog_priority }, \ | | | |
| { interface, "SyslogIdentifier", bus_property_append_s | | | |
| tring, "s", (context).syslog_identifier }, \ | | | |
| { interface, "SyslogLevelPrefix", bus_property_append_b | | | |
| ool, "b", &(context).syslog_level_prefix }, \ | | | |
| { interface, "Capabilities", bus_execute_append_ca | | | |
| pabilities, "s",&(context) }, \ | | | |
| { interface, "SecureBits", bus_property_append_i | | | |
| nt, "i", &(context).secure_bits }, \ | | | |
| { interface, "CapabilityBoundingSet", bus_execute_append_ca | | | |
| pability_bs, "t", &(context).capability_bounding_set_drop }, \ | | | |
| { interface, "User", bus_property_append_s | | | |
| tring, "s", (context).user }, \ | | | |
| { interface, "Group", bus_property_append_s | | | |
| tring, "s", (context).group }, \ | | | |
| { interface, "SupplementaryGroups", bus_property_append_s | | | |
| trv, "as", (context).supplementary_groups }, \ | | | |
| { interface, "TCPWrapName", bus_property_append_s | | | |
| tring, "s", (context).tcpwrap_name }, \ | | | |
| { interface, "PAMName", bus_property_append_s | | | |
| tring, "s", (context).pam_name }, \ | | | |
| { interface, "ReadWriteDirectories", bus_property_append_s | | | |
| trv, "as", (context).read_write_dirs }, \ | | | |
| { interface, "ReadOnlyDirectories", bus_property_append_s | | | |
| trv, "as", (context).read_only_dirs }, \ | | | |
| { interface, "InaccessibleDirectories", bus_property_append_s | | | |
| trv, "as", (context).inaccessible_dirs }, \ | | | |
| { interface, "MountFlags", bus_property_append_u | | | |
| l, "t", &(context).mount_flags }, \ | | | |
| { interface, "PrivateTmp", bus_property_append_b | | | |
| ool, "b", &(context).private_tmp }, \ | | | |
| { interface, "PrivateNetwork", bus_property_append_b | | | |
| ool, "b", &(context).private_network }, \ | | | |
| { interface, "SameProcessGroup", bus_property_append_b | | | |
| ool, "b", &(context).same_pgrp }, \ | | | |
| { interface, "KillMode", bus_execute_append_ki | | | |
| ll_mode, "s", &(context).kill_mode }, \ | | | |
| { interface, "KillSignal", bus_property_append_i | | | |
| nt, "i", &(context).kill_signal }, \ | | | |
| { interface, "UtmpIdentifier", bus_property_append_s | | | |
| tring, "s", (context).utmp_id }, \ | | | |
| { interface, "ControlGroupModify", bus_property_append_b | | | |
| ool, "b", &(context).control_group_modify } | | | |
| | | | |
| #define BUS_EXEC_STATUS_PROPERTIES(interface, estatus, prefix) \ | | | |
| { interface, prefix "StartTimestamp", bus_property_append_u | | | |
| sec, "t", &(estatus).start_timestamp.realtime }, \ | | | |
| { interface, prefix "StartTimestampMonotonic",bus_property_append_u | | | |
| sec, "t", &(estatus).start_timestamp.monotonic }, \ | | | |
| { interface, prefix "ExitTimestamp", bus_property_append_u | | | |
| sec, "t", &(estatus).start_timestamp.realtime }, \ | | | |
| { interface, prefix "ExitTimestampMonotonic", bus_property_append_u | | | |
| sec, "t", &(estatus).start_timestamp.monotonic }, \ | | | |
| { interface, prefix "PID", bus_property_append_p | | | |
| id, "u", &(estatus).pid }, \ | | | |
| { interface, prefix "Code", bus_property_append_i | | | |
| nt, "i", &(estatus).code }, \ | | | |
| { interface, prefix "Status", bus_property_append_i | | | |
| nt, "i", &(estatus).status } | | | |
| | | | |
|
| #define BUS_EXEC_COMMAND_PROPERTY(interface, command, name) \ | | #define BUS_EXEC_COMMAND_PROPERTY(name, command, indirect) \ | |
| { interface, name, bus_execute_append_command, "a(sasbttttuii)", (c | | { name, bus_execute_append_command, "a(sasbttttuii)", (command), (i | |
| ommand) } | | ndirect), NULL } | |
| | | | |
| int bus_execute_append_output(DBusMessageIter *i, const char *property, voi
d *data); | | int bus_execute_append_output(DBusMessageIter *i, const char *property, voi
d *data); | |
| int bus_execute_append_input(DBusMessageIter *i, const char *property, void
*data); | | int bus_execute_append_input(DBusMessageIter *i, const char *property, void
*data); | |
| int bus_execute_append_oom_score_adjust(DBusMessageIter *i, const char *pro
perty, void *data); | | int bus_execute_append_oom_score_adjust(DBusMessageIter *i, const char *pro
perty, void *data); | |
| int bus_execute_append_nice(DBusMessageIter *i, const char *property, void
*data); | | int bus_execute_append_nice(DBusMessageIter *i, const char *property, void
*data); | |
| int bus_execute_append_ioprio(DBusMessageIter *i, const char *property, voi
d *data); | | int bus_execute_append_ioprio(DBusMessageIter *i, const char *property, voi
d *data); | |
| int bus_execute_append_cpu_sched_policy(DBusMessageIter *i, const char *pro
perty, void *data); | | int bus_execute_append_cpu_sched_policy(DBusMessageIter *i, const char *pro
perty, void *data); | |
| int bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *p
roperty, void *data); | | int bus_execute_append_cpu_sched_priority(DBusMessageIter *i, const char *p
roperty, void *data); | |
| int bus_execute_append_affinity(DBusMessageIter *i, const char *property, v
oid *data); | | int bus_execute_append_affinity(DBusMessageIter *i, const char *property, v
oid *data); | |
| int bus_execute_append_timer_slack_nsec(DBusMessageIter *i, const char *pro
perty, void *data); | | int bus_execute_append_timer_slack_nsec(DBusMessageIter *i, const char *pro
perty, void *data); | |
| | | | |
End of changes. 4 change blocks. |
| 138 lines changed or deleted | | 6 lines changed or added | |
|
| dbus-unit.h | | dbus-unit.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| General Public License for more details. | | General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <dbus/dbus.h> | | #include <dbus/dbus.h> | |
| | | | |
| #include "manager.h" | | #include "manager.h" | |
|
| | | #include "dbus-common.h" | |
| | | | |
| #define BUS_UNIT_INTERFACE \ | | #define BUS_UNIT_INTERFACE \ | |
| " <interface name=\"org.freedesktop.systemd1.Unit\">\n" \ | | " <interface name=\"org.freedesktop.systemd1.Unit\">\n" \ | |
| " <method name=\"Start\">\n" \ | | " <method name=\"Start\">\n" \ | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | |
| " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | | " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | |
| " </method>\n" \ | | " </method>\n" \ | |
| " <method name=\"Stop\">\n" \ | | " <method name=\"Stop\">\n" \ | |
| " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | | " <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \ | |
| " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | | " <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \ | |
| | | | |
| skipping to change at line 129 | | skipping to change at line 130 | |
| " <property name=\"ConditionTimestamp\" type=\"t\" access=\"read\"
/>\n" \ | | " <property name=\"ConditionTimestamp\" type=\"t\" access=\"read\"
/>\n" \ | |
| " <property name=\"ConditionTimestampMonotonic\" type=\"t\" access
=\"read\"/>\n" \ | | " <property name=\"ConditionTimestampMonotonic\" type=\"t\" access
=\"read\"/>\n" \ | |
| " <property name=\"ConditionResult\" type=\"b\" access=\"read\"/>\
n" \ | | " <property name=\"ConditionResult\" type=\"b\" access=\"read\"/>\
n" \ | |
| " <property name=\"LoadError\" type=\"(ss)\" access=\"read\"/>\n"
\ | | " <property name=\"LoadError\" type=\"(ss)\" access=\"read\"/>\n"
\ | |
| " </interface>\n" | | " </interface>\n" | |
| | | | |
| #define BUS_UNIT_INTERFACES_LIST \ | | #define BUS_UNIT_INTERFACES_LIST \ | |
| BUS_GENERIC_INTERFACES_LIST \ | | BUS_GENERIC_INTERFACES_LIST \ | |
| "org.freedesktop.systemd1.Unit\0" | | "org.freedesktop.systemd1.Unit\0" | |
| | | | |
|
| #define BUS_UNIT_PROPERTIES \ | | extern const BusProperty bus_unit_properties[]; | |
| { "org.freedesktop.systemd1.Unit", "Id", bus_prop | | | |
| erty_append_string, "s", u->meta.id }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Names", bus_unit | | | |
| _append_names, "as", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Following", bus_unit | | | |
| _append_following, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Requires", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUIRES] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RequiresOverridable", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUIRES_OVERRIDA | | | |
| BLE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Requisite", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUISITE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RequisiteOverridable", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUISITE_OVERRID | | | |
| ABLE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Wants", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_WANTS] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "BindTo", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_BIND_TO] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RequiredBy", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUIRED_BY] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RequiredByOverridable",bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_REQUIRED_BY_OVERR | | | |
| IDABLE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "WantedBy", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_WANTED_BY] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "BoundBy", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_BOUND_BY] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Conflicts", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_CONFLICTS] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ConflictedBy", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_CONFLICTED_BY] }, | | | |
| \ | | | |
| { "org.freedesktop.systemd1.Unit", "Before", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_BEFORE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "After", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_AFTER] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "OnFailure", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_ON_FAILURE] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Triggers", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_TRIGGERS] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "TriggeredBy", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_TRIGGERED_BY] }, | | | |
| \ | | | |
| { "org.freedesktop.systemd1.Unit", "PropagateReloadTo", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_PROPAGATE_RELOAD_ | | | |
| TO] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "PropagateReloadFrom", bus_unit | | | |
| _append_dependencies, "as", u->meta.dependencies[UNIT_PROPAGATE_RELOAD_ | | | |
| FROM] }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Description", bus_unit | | | |
| _append_description, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "LoadState", bus_unit | | | |
| _append_load_state, "s", &u->meta.load_state }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ActiveState", bus_unit | | | |
| _append_active_state, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "SubState", bus_unit | | | |
| _append_sub_state, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "FragmentPath", bus_prop | | | |
| erty_append_string, "s", u->meta.fragment_path }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "UnitFileState", bus_unit | | | |
| _append_file_state, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "InactiveExitTimestamp",bus_prop | | | |
| erty_append_usec, "t", &u->meta.inactive_exit_timestamp.realtime } | | | |
| , \ | | | |
| { "org.freedesktop.systemd1.Unit", "InactiveExitTimestampMonotonic" | | | |
| ,bus_property_append_usec, "t", &u->meta.inactive_exit_timestamp.monotonic | | | |
| }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestamp", bus_prop | | | |
| erty_append_usec, "t", &u->meta.active_enter_timestamp.realtime }, | | | |
| \ | | | |
| { "org.freedesktop.systemd1.Unit", "ActiveEnterTimestampMonotonic", | | | |
| bus_property_append_usec, "t", &u->meta.active_enter_timestamp.monotonic } | | | |
| , \ | | | |
| { "org.freedesktop.systemd1.Unit", "ActiveExitTimestamp", bus_prop | | | |
| erty_append_usec, "t", &u->meta.active_exit_timestamp.realtime }, | | | |
| \ | | | |
| { "org.freedesktop.systemd1.Unit", "ActiveExitTimestampMonotonic", | | | |
| bus_property_append_usec, "t", &u->meta.active_exit_timestamp.monotonic }, | | | |
| \ | | | |
| { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestamp",bus_pro | | | |
| perty_append_usec, "t", &u->meta.inactive_enter_timestamp.realtime | | | |
| }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "InactiveEnterTimestampMonotonic | | | |
| ",bus_property_append_usec,"t", &u->meta.inactive_enter_timestamp.monotonic | | | |
| }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "CanStart", bus_unit | | | |
| _append_can_start, "b", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "CanStop", bus_unit | | | |
| _append_can_stop, "b", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "CanReload", bus_unit | | | |
| _append_can_reload, "b", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "CanIsolate", bus_unit | | | |
| _append_can_isolate, "b", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "Job", bus_unit | | | |
| _append_job, "(uo)", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "StopWhenUnneeded", bus_prop | | | |
| erty_append_bool, "b", &u->meta.stop_when_unneeded }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RefuseManualStart", bus_prop | | | |
| erty_append_bool, "b", &u->meta.refuse_manual_start }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "RefuseManualStop", bus_prop | | | |
| erty_append_bool, "b", &u->meta.refuse_manual_stop }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "AllowIsolate", bus_prop | | | |
| erty_append_bool, "b", &u->meta.allow_isolate }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "DefaultDependencies", bus_prop | | | |
| erty_append_bool, "b", &u->meta.default_dependencies }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "OnFailureIsolate", bus_prop | | | |
| erty_append_bool, "b", &u->meta.on_failure_isolate }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "IgnoreOnIsolate", bus_prop | | | |
| erty_append_bool, "b", &u->meta.ignore_on_isolate }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "IgnoreOnSnapshot", bus_prop | | | |
| erty_append_bool, "b", &u->meta.ignore_on_snapshot }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "DefaultControlGroup", bus_unit | | | |
| _append_default_cgroup, "s", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ControlGroup", bus_unit | | | |
| _append_cgroups, "as", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ControlGroupAttributes", bus_un | | | |
| it_append_cgroup_attrs, "a(sss)", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "NeedDaemonReload", bus_unit | | | |
| _append_need_daemon_reload, "b", u }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "JobTimeoutUSec", bus_prop | | | |
| erty_append_usec, "t", &u->meta.job_timeout }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ConditionTimestamp", bus_prop | | | |
| erty_append_usec, "t", &u->meta.condition_timestamp.realtime }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ConditionTimestampMonotonic", b | | | |
| us_property_append_usec,"t", &u->meta.condition_timestamp.monotonic }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "ConditionResult", bus_prop | | | |
| erty_append_bool, "b", &u->meta.condition_result }, \ | | | |
| { "org.freedesktop.systemd1.Unit", "LoadError", bus_unit | | | |
| _append_load_error, "(ss)", u } | | | |
| | | | |
| int bus_unit_append_names(DBusMessageIter *i, const char *property, void *d | | | |
| ata); | | | |
| int bus_unit_append_following(DBusMessageIter *i, const char *property, voi | | | |
| d *data); | | | |
| int bus_unit_append_dependencies(DBusMessageIter *i, const char *property, | | | |
| void *data); | | | |
| int bus_unit_append_description(DBusMessageIter *i, const char *property, v | | | |
| oid *data); | | | |
| int bus_unit_append_load_state(DBusMessageIter *i, const char *property, vo | | | |
| id *data); | | | |
| int bus_unit_append_active_state(DBusMessageIter *i, const char *property, | | | |
| void *data); | | | |
| int bus_unit_append_sub_state(DBusMessageIter *i, const char *property, voi | | | |
| d *data); | | | |
| int bus_unit_append_file_state(DBusMessageIter *i, const char *property, vo | | | |
| id *data); | | | |
| int bus_unit_append_can_start(DBusMessageIter *i, const char *property, voi | | | |
| d *data); | | | |
| int bus_unit_append_can_stop(DBusMessageIter *i, const char *property, void | | | |
| *data); | | | |
| int bus_unit_append_can_reload(DBusMessageIter *i, const char *property, vo | | | |
| id *data); | | | |
| int bus_unit_append_can_isolate(DBusMessageIter *i, const char *property, v | | | |
| oid *data); | | | |
| int bus_unit_append_job(DBusMessageIter *i, const char *property, void *dat | | | |
| a); | | | |
| int bus_unit_append_default_cgroup(DBusMessageIter *i, const char *property | | | |
| , void *data); | | | |
| int bus_unit_append_cgroups(DBusMessageIter *i, const char *property, void | | | |
| *data); | | | |
| int bus_unit_append_cgroup_attrs(DBusMessageIter *i, const char *property, | | | |
| void *data); | | | |
| int bus_unit_append_need_daemon_reload(DBusMessageIter *i, const char *prop | | | |
| erty, void *data); | | | |
| int bus_unit_append_load_error(DBusMessageIter *i, const char *property, vo | | | |
| id *data); | | | |
| | | | |
| void bus_unit_send_change_signal(Unit *u); | | void bus_unit_send_change_signal(Unit *u); | |
| void bus_unit_send_removed_signal(Unit *u); | | void bus_unit_send_removed_signal(Unit *u); | |
| | | | |
| extern const DBusObjectPathVTable bus_unit_vtable; | | extern const DBusObjectPathVTable bus_unit_vtable; | |
| | | | |
| extern const char bus_unit_interface[]; | | extern const char bus_unit_interface[]; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 2 change blocks. |
| 169 lines changed or deleted | | 2 lines changed or added | |
|
| manager.h | | manager.h | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| WATCH_SWAP, | | WATCH_SWAP, | |
| WATCH_UDEV, | | WATCH_UDEV, | |
| WATCH_DBUS_WATCH, | | WATCH_DBUS_WATCH, | |
| WATCH_DBUS_TIMEOUT | | WATCH_DBUS_TIMEOUT | |
| }; | | }; | |
| | | | |
| struct Watch { | | struct Watch { | |
| int fd; | | int fd; | |
| WatchType type; | | WatchType type; | |
| union { | | union { | |
|
| union Unit *unit; | | struct Unit *unit; | |
| struct Job *job; | | struct Job *job; | |
| DBusWatch *bus_watch; | | DBusWatch *bus_watch; | |
| DBusTimeout *bus_timeout; | | DBusTimeout *bus_timeout; | |
| } data; | | } data; | |
| bool fd_is_dupped:1; | | bool fd_is_dupped:1; | |
| bool socket_accept:1; | | bool socket_accept:1; | |
| }; | | }; | |
| | | | |
| #include "unit.h" | | #include "unit.h" | |
| #include "job.h" | | #include "job.h" | |
| | | | |
| skipping to change at line 105 | | skipping to change at line 105 | |
| /* Note that the set of units we know of is allowed to be | | /* Note that the set of units we know of is allowed to be | |
| * inconsistent. However the subset of it that is loaded may | | * inconsistent. However the subset of it that is loaded may | |
| * not, and the list of jobs may neither. */ | | * not, and the list of jobs may neither. */ | |
| | | | |
| /* Active jobs and units */ | | /* Active jobs and units */ | |
| Hashmap *units; /* name string => Unit object n:1 */ | | Hashmap *units; /* name string => Unit object n:1 */ | |
| Hashmap *jobs; /* job id => Job object 1:1 */ | | Hashmap *jobs; /* job id => Job object 1:1 */ | |
| | | | |
| /* To make it easy to iterate through the units of a specific | | /* To make it easy to iterate through the units of a specific | |
| * type we maintain a per type linked list */ | | * type we maintain a per type linked list */ | |
|
| LIST_HEAD(Meta, units_by_type[_UNIT_TYPE_MAX]); | | LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]); | |
| | | | |
| /* Units that need to be loaded */ | | /* Units that need to be loaded */ | |
|
| LIST_HEAD(Meta, load_queue); /* this is actually more a stack than
a queue, but uh. */ | | LIST_HEAD(Unit, load_queue); /* this is actually more a stack than
a queue, but uh. */ | |
| | | | |
| /* Jobs that need to be run */ | | /* Jobs that need to be run */ | |
| LIST_HEAD(Job, run_queue); /* more a stack than a queue, too */ | | LIST_HEAD(Job, run_queue); /* more a stack than a queue, too */ | |
| | | | |
| /* Units and jobs that have not yet been announced via | | /* Units and jobs that have not yet been announced via | |
| * D-Bus. When something about a job changes it is added here | | * D-Bus. When something about a job changes it is added here | |
| * if it is not in there yet. This allows easy coalescing of | | * if it is not in there yet. This allows easy coalescing of | |
| * D-Bus change signals. */ | | * D-Bus change signals. */ | |
|
| LIST_HEAD(Meta, dbus_unit_queue); | | LIST_HEAD(Unit, dbus_unit_queue); | |
| LIST_HEAD(Job, dbus_job_queue); | | LIST_HEAD(Job, dbus_job_queue); | |
| | | | |
| /* Units to remove */ | | /* Units to remove */ | |
|
| LIST_HEAD(Meta, cleanup_queue); | | LIST_HEAD(Unit, cleanup_queue); | |
| | | | |
| /* Units to check when doing GC */ | | /* Units to check when doing GC */ | |
|
| LIST_HEAD(Meta, gc_queue); | | LIST_HEAD(Unit, gc_queue); | |
| | | | |
| /* Jobs to be added */ | | /* Jobs to be added */ | |
| Hashmap *transaction_jobs; /* Unit object => Job object list 1
:1 */ | | Hashmap *transaction_jobs; /* Unit object => Job object list 1
:1 */ | |
| JobDependency *transaction_anchor; | | JobDependency *transaction_anchor; | |
| | | | |
| Hashmap *watch_pids; /* pid => Unit object n:1 */ | | Hashmap *watch_pids; /* pid => Unit object n:1 */ | |
| | | | |
| char *notify_socket; | | char *notify_socket; | |
| | | | |
| Watch notify_watch; | | Watch notify_watch; | |
| | | | |
| skipping to change at line 292 | | skipping to change at line 292 | |
| void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | | void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success); | |
| void manager_send_unit_plymouth(Manager *m, Unit *u); | | void manager_send_unit_plymouth(Manager *m, Unit *u); | |
| | | | |
| bool manager_unit_pending_inactive(Manager *m, const char *name); | | bool manager_unit_pending_inactive(Manager *m, const char *name); | |
| | | | |
| void manager_check_finished(Manager *m); | | void manager_check_finished(Manager *m); | |
| | | | |
| void manager_run_generators(Manager *m); | | void manager_run_generators(Manager *m); | |
| void manager_undo_generators(Manager *m); | | void manager_undo_generators(Manager *m); | |
| | | | |
|
| void manager_recheck_syslog(Manager *m); | | void manager_recheck_journal(Manager *m); | |
| | | | |
| void manager_set_show_status(Manager *m, bool b); | | void manager_set_show_status(Manager *m, bool b); | |
| bool manager_get_show_status(Manager *m); | | bool manager_get_show_status(Manager *m); | |
| | | | |
| const char *manager_running_as_to_string(ManagerRunningAs i); | | const char *manager_running_as_to_string(ManagerRunningAs i); | |
| ManagerRunningAs manager_running_as_from_string(const char *s); | | ManagerRunningAs manager_running_as_from_string(const char *s); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|
| unit.h | | unit.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| General Public License for more details. | | General Public License for more details. | |
| | | | |
| You should have received a copy of the GNU General Public License | | You should have received a copy of the GNU General Public License | |
| along with systemd; If not, see <http://www.gnu.org/licenses/>. | | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
| ***/ | | ***/ | |
| | | | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| | | | |
|
| typedef union Unit Unit; | | typedef struct Unit Unit; | |
| typedef struct Meta Meta; | | | |
| typedef struct UnitVTable UnitVTable; | | typedef struct UnitVTable UnitVTable; | |
| typedef enum UnitType UnitType; | | typedef enum UnitType UnitType; | |
| typedef enum UnitLoadState UnitLoadState; | | typedef enum UnitLoadState UnitLoadState; | |
| typedef enum UnitActiveState UnitActiveState; | | typedef enum UnitActiveState UnitActiveState; | |
| typedef enum UnitDependency UnitDependency; | | typedef enum UnitDependency UnitDependency; | |
| typedef struct UnitRef UnitRef; | | typedef struct UnitRef UnitRef; | |
| | | | |
| #include "set.h" | | #include "set.h" | |
| #include "util.h" | | #include "util.h" | |
| #include "list.h" | | #include "list.h" | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 143 | |
| | | | |
| _UNIT_DEPENDENCY_MAX, | | _UNIT_DEPENDENCY_MAX, | |
| _UNIT_DEPENDENCY_INVALID = -1 | | _UNIT_DEPENDENCY_INVALID = -1 | |
| }; | | }; | |
| | | | |
| #include "manager.h" | | #include "manager.h" | |
| #include "job.h" | | #include "job.h" | |
| #include "cgroup.h" | | #include "cgroup.h" | |
| #include "cgroup-attr.h" | | #include "cgroup-attr.h" | |
| | | | |
|
| struct Meta { | | struct Unit { | |
| Manager *manager; | | Manager *manager; | |
| | | | |
| UnitType type; | | UnitType type; | |
| UnitLoadState load_state; | | UnitLoadState load_state; | |
| Unit *merged_into; | | Unit *merged_into; | |
| | | | |
| char *id; /* One name is special because we use it for identificati
on. Points to an entry in the names set */ | | char *id; /* One name is special because we use it for identificati
on. Points to an entry in the names set */ | |
| char *instance; | | char *instance; | |
| | | | |
| Set *names; | | Set *names; | |
| | | | |
| skipping to change at line 186 | | skipping to change at line 185 | |
| dual_timestamp inactive_exit_timestamp; | | dual_timestamp inactive_exit_timestamp; | |
| dual_timestamp active_enter_timestamp; | | dual_timestamp active_enter_timestamp; | |
| dual_timestamp active_exit_timestamp; | | dual_timestamp active_exit_timestamp; | |
| dual_timestamp inactive_enter_timestamp; | | dual_timestamp inactive_enter_timestamp; | |
| | | | |
| /* Counterparts in the cgroup filesystem */ | | /* Counterparts in the cgroup filesystem */ | |
| CGroupBonding *cgroup_bondings; | | CGroupBonding *cgroup_bondings; | |
| CGroupAttribute *cgroup_attributes; | | CGroupAttribute *cgroup_attributes; | |
| | | | |
| /* Per type list */ | | /* Per type list */ | |
|
| LIST_FIELDS(Meta, units_by_type); | | LIST_FIELDS(Unit, units_by_type); | |
| | | | |
| /* Load queue */ | | /* Load queue */ | |
|
| LIST_FIELDS(Meta, load_queue); | | LIST_FIELDS(Unit, load_queue); | |
| | | | |
| /* D-Bus queue */ | | /* D-Bus queue */ | |
|
| LIST_FIELDS(Meta, dbus_queue); | | LIST_FIELDS(Unit, dbus_queue); | |
| | | | |
| /* Cleanup queue */ | | /* Cleanup queue */ | |
|
| LIST_FIELDS(Meta, cleanup_queue); | | LIST_FIELDS(Unit, cleanup_queue); | |
| | | | |
| /* GC queue */ | | /* GC queue */ | |
|
| LIST_FIELDS(Meta, gc_queue); | | LIST_FIELDS(Unit, gc_queue); | |
| | | | |
| /* Used during GC sweeps */ | | /* Used during GC sweeps */ | |
| unsigned gc_marker; | | unsigned gc_marker; | |
| | | | |
| /* When deserializing, temporarily store the job type for this | | /* When deserializing, temporarily store the job type for this | |
| * unit here, if there was a job scheduled */ | | * unit here, if there was a job scheduled */ | |
| int deserialized_job; /* This is actually of type JobType */ | | int deserialized_job; /* This is actually of type JobType */ | |
| | | | |
| /* Error code when we didn't manage to load the unit (negative) */ | | /* Error code when we didn't manage to load the unit (negative) */ | |
| int load_error; | | int load_error; | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 271 | |
| #include "timer.h" | | #include "timer.h" | |
| #include "socket.h" | | #include "socket.h" | |
| #include "target.h" | | #include "target.h" | |
| #include "device.h" | | #include "device.h" | |
| #include "mount.h" | | #include "mount.h" | |
| #include "automount.h" | | #include "automount.h" | |
| #include "snapshot.h" | | #include "snapshot.h" | |
| #include "swap.h" | | #include "swap.h" | |
| #include "path.h" | | #include "path.h" | |
| | | | |
|
| union Unit { | | | |
| Meta meta; | | | |
| Service service; | | | |
| Timer timer; | | | |
| Socket socket; | | | |
| Target target; | | | |
| Device device; | | | |
| Mount mount; | | | |
| Automount automount; | | | |
| Snapshot snapshot; | | | |
| Swap swap; | | | |
| Path path; | | | |
| }; | | | |
| | | | |
| struct UnitVTable { | | struct UnitVTable { | |
| const char *suffix; | | const char *suffix; | |
| | | | |
|
| | | /* How much memory does an object of this unit type need */ | |
| | | size_t object_size; | |
| | | | |
| /* Config file sections this unit type understands, separated | | /* Config file sections this unit type understands, separated | |
| * by NUL chars */ | | * by NUL chars */ | |
| const char *sections; | | const char *sections; | |
| | | | |
| /* This should reset all type-specific variables. This should | | /* This should reset all type-specific variables. This should | |
| * not allocate memory, and is called with zero-initialized | | * not allocate memory, and is called with zero-initialized | |
| * data. It should hence only initialize variables that need | | * data. It should hence only initialize variables that need | |
| * to be set != 0. */ | | * to be set != 0. */ | |
| void (*init)(Unit *u); | | void (*init)(Unit *u); | |
| | | | |
| | | | |
| skipping to change at line 413 | | skipping to change at line 401 | |
| | | | |
| /* Exclude from automatic gc */ | | /* Exclude from automatic gc */ | |
| bool no_gc:1; | | bool no_gc:1; | |
| | | | |
| /* Show status updates on the console */ | | /* Show status updates on the console */ | |
| bool show_status:1; | | bool show_status:1; | |
| }; | | }; | |
| | | | |
| extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | | extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX]; | |
| | | | |
|
| #define UNIT_VTABLE(u) unit_vtable[(u)->meta.type] | | #define UNIT_VTABLE(u) unit_vtable[(u)->type] | |
| | | | |
| /* For casting a unit into the various unit types */ | | /* For casting a unit into the various unit types */ | |
| #define DEFINE_CAST(UPPERCASE, MixedCase) \ | | #define DEFINE_CAST(UPPERCASE, MixedCase) \ | |
| static inline MixedCase* UPPERCASE(Unit *u) { \ | | static inline MixedCase* UPPERCASE(Unit *u) { \ | |
|
| if (_unlikely_(!u || u->meta.type != UNIT_##UPPERCASE)) \ | | if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \ | |
| return NULL; \ | | return NULL; \ | |
| \ | | \ | |
| return (MixedCase*) u; \ | | return (MixedCase*) u; \ | |
| } | | } | |
| | | | |
| /* For casting the various unit types into a unit */ | | /* For casting the various unit types into a unit */ | |
|
| #define UNIT(u) ((Unit*) (&(u)->meta)) | | #define UNIT(u) (&(u)->meta) | |
| | | | |
| DEFINE_CAST(SOCKET, Socket); | | DEFINE_CAST(SOCKET, Socket); | |
| DEFINE_CAST(TIMER, Timer); | | DEFINE_CAST(TIMER, Timer); | |
| DEFINE_CAST(SERVICE, Service); | | DEFINE_CAST(SERVICE, Service); | |
| DEFINE_CAST(TARGET, Target); | | DEFINE_CAST(TARGET, Target); | |
| DEFINE_CAST(DEVICE, Device); | | DEFINE_CAST(DEVICE, Device); | |
| DEFINE_CAST(MOUNT, Mount); | | DEFINE_CAST(MOUNT, Mount); | |
| DEFINE_CAST(AUTOMOUNT, Automount); | | DEFINE_CAST(AUTOMOUNT, Automount); | |
| DEFINE_CAST(SNAPSHOT, Snapshot); | | DEFINE_CAST(SNAPSHOT, Snapshot); | |
| DEFINE_CAST(SWAP, Swap); | | DEFINE_CAST(SWAP, Swap); | |
| DEFINE_CAST(PATH, Path); | | DEFINE_CAST(PATH, Path); | |
| | | | |
|
| Unit *unit_new(Manager *m); | | Unit *unit_new(Manager *m, size_t size); | |
| void unit_free(Unit *u); | | void unit_free(Unit *u); | |
| | | | |
| int unit_add_name(Unit *u, const char *name); | | int unit_add_name(Unit *u, const char *name); | |
| | | | |
| int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_re
ference); | | int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_re
ference); | |
| int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e,
Unit *other, bool add_reference); | | int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e,
Unit *other, bool add_reference); | |
| | | | |
| int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name
, const char *filename, bool add_reference); | | int unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name
, const char *filename, bool add_reference); | |
| int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend
ency e, const char *name, const char *path, bool add_reference); | | int unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDepend
ency e, const char *name, const char *path, bool add_reference); | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 26 lines changed or deleted | | 14 lines changed or added | |
|
| util.h | | util.h | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 70 | |
| | | | |
| /* What is interpreted as whitespace? */ | | /* What is interpreted as whitespace? */ | |
| #define WHITESPACE " \t\n\r" | | #define WHITESPACE " \t\n\r" | |
| #define NEWLINE "\n\r" | | #define NEWLINE "\n\r" | |
| #define QUOTES "\"\'" | | #define QUOTES "\"\'" | |
| #define COMMENTS "#;\n" | | #define COMMENTS "#;\n" | |
| | | | |
| #define FORMAT_TIMESTAMP_MAX 64 | | #define FORMAT_TIMESTAMP_MAX 64 | |
| #define FORMAT_TIMESTAMP_PRETTY_MAX 256 | | #define FORMAT_TIMESTAMP_PRETTY_MAX 256 | |
| #define FORMAT_TIMESPAN_MAX 64 | | #define FORMAT_TIMESPAN_MAX 64 | |
|
| | | #define FORMAT_BYTES_MAX 8 | |
| | | | |
|
| #define ANSI_HIGHLIGHT_ON "\x1B[1;31m" | | #define ANSI_HIGHLIGHT_ON "\x1B[1;39m" | |
| | | #define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m" | |
| #define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m" | | #define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m" | |
| #define ANSI_HIGHLIGHT_OFF "\x1B[0m" | | #define ANSI_HIGHLIGHT_OFF "\x1B[0m" | |
| | | | |
| usec_t now(clockid_t clock); | | usec_t now(clockid_t clock); | |
| | | | |
| dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | | dual_timestamp* dual_timestamp_get(dual_timestamp *ts); | |
| dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | | dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u); | |
| | | | |
| #define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | | #define dual_timestamp_is_set(ts) ((ts)->realtime > 0) | |
| | | | |
| | | | |
| skipping to change at line 328 | | skipping to change at line 330 | |
| | | | |
| int fd_nonblock(int fd, bool nonblock); | | int fd_nonblock(int fd, bool nonblock); | |
| int fd_cloexec(int fd, bool cloexec); | | int fd_cloexec(int fd, bool cloexec); | |
| | | | |
| int close_all_fds(const int except[], unsigned n_except); | | int close_all_fds(const int except[], unsigned n_except); | |
| | | | |
| bool fstype_is_network(const char *fstype); | | bool fstype_is_network(const char *fstype); | |
| | | | |
| int chvt(int vt); | | int chvt(int vt); | |
| | | | |
|
| int read_one_char(FILE *f, char *ret, bool *need_nl); | | int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl); | |
| int ask(char *ret, const char *replies, const char *text, ...); | | int ask(char *ret, const char *replies, const char *text, ...); | |
| | | | |
| int reset_terminal_fd(int fd); | | int reset_terminal_fd(int fd); | |
| int reset_terminal(const char *name); | | int reset_terminal(const char *name); | |
| | | | |
| int open_terminal(const char *name, int mode); | | int open_terminal(const char *name, int mode); | |
| int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t
iocstty_eperm); | | int acquire_terminal(const char *name, bool fail, bool force, bool ignore_t
iocstty_eperm); | |
| int release_terminal(void); | | int release_terminal(void); | |
| | | | |
| int flush_fd(int fd); | | int flush_fd(int fd); | |
| | | | |
| skipping to change at line 385 | | skipping to change at line 387 | |
| | | | |
| cpu_set_t* cpu_set_malloc(unsigned *ncpus); | | cpu_set_t* cpu_set_malloc(unsigned *ncpus); | |
| | | | |
| void status_vprintf(const char *status, bool ellipse, const char *format, v
a_list ap); | | void status_vprintf(const char *status, bool ellipse, const char *format, v
a_list ap); | |
| void status_printf(const char *status, bool ellipse, const char *format, ..
.); | | void status_printf(const char *status, bool ellipse, const char *format, ..
.); | |
| void status_welcome(void); | | void status_welcome(void); | |
| | | | |
| int fd_columns(int fd); | | int fd_columns(int fd); | |
| unsigned columns(void); | | unsigned columns(void); | |
| | | | |
|
| | | int fd_lines(int fd); | |
| | | unsigned lines(void); | |
| | | | |
| int running_in_chroot(void); | | int running_in_chroot(void); | |
| | | | |
| char *ellipsize(const char *s, size_t length, unsigned percent); | | char *ellipsize(const char *s, size_t length, unsigned percent); | |
| char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, un
signed percent); | | char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, un
signed percent); | |
| | | | |
| int touch(const char *path); | | int touch(const char *path); | |
| | | | |
| char *unquote(const char *s, const char *quotes); | | char *unquote(const char *s, const char *quotes); | |
| char *normalize_env_assignment(const char *s); | | char *normalize_env_assignment(const char *s); | |
| | | | |
| | | | |
| skipping to change at line 413 | | skipping to change at line 418 | |
| DIR *xopendirat(int dirfd, const char *name, int flags); | | DIR *xopendirat(int dirfd, const char *name, int flags); | |
| | | | |
| void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t)
; | | void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t)
; | |
| void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | | void dual_timestamp_deserialize(const char *value, dual_timestamp *t); | |
| | | | |
| char *fstab_node_to_udev_node(const char *p); | | char *fstab_node_to_udev_node(const char *p); | |
| | | | |
| void filter_environ(const char *prefix); | | void filter_environ(const char *prefix); | |
| | | | |
| bool tty_is_vc(const char *tty); | | bool tty_is_vc(const char *tty); | |
|
| | | bool tty_is_vc_resolve(const char *tty); | |
| int vtnr_from_tty(const char *tty); | | int vtnr_from_tty(const char *tty); | |
| const char *default_term_for_tty(const char *tty); | | const char *default_term_for_tty(const char *tty); | |
| | | | |
| void execute_directory(const char *directory, DIR *_d, char *argv[]); | | void execute_directory(const char *directory, DIR *_d, char *argv[]); | |
| | | | |
| int kill_and_sigcont(pid_t pid, int sig); | | int kill_and_sigcont(pid_t pid, int sig); | |
| | | | |
| bool nulstr_contains(const char*nulstr, const char *needle); | | bool nulstr_contains(const char*nulstr, const char *needle); | |
| | | | |
| bool plymouth_running(void); | | bool plymouth_running(void); | |
| | | | |
| skipping to change at line 478 | | skipping to change at line 484 | |
| int get_files_in_directory(const char *path, char ***list); | | int get_files_in_directory(const char *path, char ***list); | |
| | | | |
| char *join(const char *x, ...) _sentinel_; | | char *join(const char *x, ...) _sentinel_; | |
| | | | |
| bool is_main_thread(void); | | bool is_main_thread(void); | |
| | | | |
| bool in_charset(const char *s, const char* charset); | | bool in_charset(const char *s, const char* charset); | |
| | | | |
| int block_get_whole_disk(dev_t d, dev_t *ret); | | int block_get_whole_disk(dev_t d, dev_t *ret); | |
| | | | |
|
| int file_is_sticky(const char *p); | | int file_is_priv_sticky(const char *p); | |
| | | | |
| int strdup_or_null(const char *a, char **b); | | int strdup_or_null(const char *a, char **b); | |
| | | | |
| #define NULSTR_FOREACH(i, l) \ | | #define NULSTR_FOREACH(i, l) \ | |
| for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | | for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) | |
| | | | |
| #define NULSTR_FOREACH_PAIR(i, j, l) \ | | #define NULSTR_FOREACH_PAIR(i, j, l) \ | |
| for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((
j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) | | for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((
j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i)) | |
| | | | |
| const char *ioprio_class_to_string(int i); | | const char *ioprio_class_to_string(int i); | |
| | | | |
| skipping to change at line 525 | | skipping to change at line 531 | |
| extern char **saved_argv; | | extern char **saved_argv; | |
| | | | |
| bool kexec_loaded(void); | | bool kexec_loaded(void); | |
| | | | |
| int prot_from_flags(int flags); | | int prot_from_flags(int flags); | |
| | | | |
| unsigned long cap_last_cap(void); | | unsigned long cap_last_cap(void); | |
| | | | |
| char *format_bytes(char *buf, size_t l, off_t t); | | char *format_bytes(char *buf, size_t l, off_t t); | |
| | | | |
|
| int fd_wait_for_event(int fd, int event); | | int fd_wait_for_event(int fd, int event, usec_t timeout); | |
| | | | |
| void* memdup(const void *p, size_t l); | | void* memdup(const void *p, size_t l); | |
| | | | |
|
| | | int rtc_open(int flags); | |
| | | | |
| | | int is_kernel_thread(pid_t pid); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 4 lines changed or deleted | | 14 lines changed or added | |
|