core: remove the redundancy of 'n_fds' and 'n_storage_fds' in ExecParameters struct
authorFranck Bui <fbui@suse.com>
Thu, 8 Jun 2017 13:41:26 +0000 (15:41 +0200)
committerFranck Bui <fbui@suse.com>
Thu, 8 Jun 2017 14:21:35 +0000 (16:21 +0200)
commit4c47affcf1e501431f3cb567c516ec252dfc4bbc
tree18d9c246fb51b5039435616f715e654df048cf0a
parent9b1419111aee0f4dca07593bd8e6db4ed94ce141
core: remove the redundancy of 'n_fds' and 'n_storage_fds' in ExecParameters struct

'n_fds' field in the ExecParameters structure was counting the total number of
file descriptors to be passed to a unit.

This counter also includes the number of passed socket fds which is counted by
'n_socket_fds' already.

This patch removes that redundancy by replacing 'n_fds' with
'n_storage_fds'. The new field only counts the fds passed via the storage store
mechanism.  That way each fd is counted at one place only.

Subsequently the patch makes sure to fix code that used 'n_fds' and also wanted
to iterate through all of them by explicitly adding 'n_socket_fds' + 'n_storage_fds'.

Suggested by Lennart.
src/core/execute.c
src/core/execute.h
src/core/service.c