All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] lib/signames: remove unused function
@ 2017-11-26 17:47 Sami Kerola
  2017-11-26 17:47 ` [PATCH 2/3] logindefs: " Sami Kerola
  2017-11-26 17:47 ` [PATCH 3/3] eject: remove list_speeds() #ifdef CDROM_SELECT_SPEED protection Sami Kerola
  0 siblings, 2 replies; 4+ messages in thread
From: Sami Kerola @ 2017-11-26 17:47 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 include/signames.h | 1 -
 lib/signames.c     | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/include/signames.h b/include/signames.h
index 2096ad845..a4fd1bc59 100644
--- a/include/signames.h
+++ b/include/signames.h
@@ -3,7 +3,6 @@
 
 int signame_to_signum(const char *sig);
 const char *signum_to_signame(int signum);
-size_t get_numof_signames(void);
 int get_signame_by_idx(size_t idx, const char **signame, int *signum);
 
 #endif /* SIGNAMES_H */
diff --git a/lib/signames.c b/lib/signames.c
index a654e88b1..316eec527 100644
--- a/lib/signames.c
+++ b/lib/signames.c
@@ -189,11 +189,6 @@ const char *signum_to_signame(int signum)
 	return NULL;
 }
 
-size_t get_numof_signames(void)
-{
-	return ARRAY_SIZE(ul_signames);
-}
-
 int get_signame_by_idx(size_t idx, const char **signame, int *signum)
 {
 	if (idx >= ARRAY_SIZE(ul_signames))
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] logindefs: remove unused function
  2017-11-26 17:47 [PATCH 1/3] lib/signames: remove unused function Sami Kerola
@ 2017-11-26 17:47 ` Sami Kerola
  2017-11-28 13:52   ` Karel Zak
  2017-11-26 17:47 ` [PATCH 3/3] eject: remove list_speeds() #ifdef CDROM_SELECT_SPEED protection Sami Kerola
  1 sibling, 1 reply; 4+ messages in thread
From: Sami Kerola @ 2017-11-26 17:47 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 login-utils/logindefs.c | 18 ------------------
 login-utils/logindefs.h |  1 -
 2 files changed, 19 deletions(-)

diff --git a/login-utils/logindefs.c b/login-utils/logindefs.c
index ebf1a9f3a..18a699d6b 100644
--- a/login-utils/logindefs.c
+++ b/login-utils/logindefs.c
@@ -51,24 +51,6 @@ static struct item *list = NULL;
 static void (*logindefs_loader)(void *) = NULL;
 static void *logindefs_loader_data = NULL;
 
-void free_getlogindefs_data(void)
-{
-	struct item *ptr;
-
-	ptr = list;
-	while (ptr) {
-		struct item *tmp = ptr->next;
-
-		free(ptr->path);
-		free(ptr->name);
-		free(ptr->value);
-		free(ptr);
-		ptr = tmp;
-	}
-
-	list = NULL;
-}
-
 static void store(const char *name, const char *value, const char *path)
 {
 	struct item *new = xmalloc(sizeof(struct item));
diff --git a/login-utils/logindefs.h b/login-utils/logindefs.h
index 064737c6c..0079cd23c 100644
--- a/login-utils/logindefs.h
+++ b/login-utils/logindefs.h
@@ -6,7 +6,6 @@ extern void logindefs_set_loader(void (*loader)(void *data), void *data);
 extern int getlogindefs_bool(const char *name, int dflt);
 extern unsigned long getlogindefs_num(const char *name, long dflt);
 extern const char *getlogindefs_str(const char *name, const char *dflt);
-extern void free_getlogindefs_data(void);
 extern int logindefs_setenv(const char *name, const char *conf, const char *dflt);
 extern int effective_access(const char *path, int mode);
 extern int get_hushlogin_status(struct passwd *pwd, int force_check);
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] eject: remove list_speeds() #ifdef CDROM_SELECT_SPEED protection
  2017-11-26 17:47 [PATCH 1/3] lib/signames: remove unused function Sami Kerola
  2017-11-26 17:47 ` [PATCH 2/3] logindefs: " Sami Kerola
@ 2017-11-26 17:47 ` Sami Kerola
  1 sibling, 0 replies; 4+ messages in thread
From: Sami Kerola @ 2017-11-26 17:47 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

The CDROM_SELECT_SPEED should be available practically everywhere.  Where
the define is missing an error message about path /proc/sys/dev/cdrom/info
cannot be opened is better error than a warnx() about kernel support.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 sys-utils/eject.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index aa90ff72f..a38c5c38c 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -548,7 +548,6 @@ static int read_speed(const char *devname)
  */
 static void list_speeds(struct eject_control *ctl)
 {
-#ifdef CDROM_SELECT_SPEED
 	int max_speed, curr_speed = 0;
 
 	select_speed(ctl);
@@ -565,9 +564,6 @@ static void list_speeds(struct eject_control *ctl)
 	}
 
 	printf("\n");
-#else
-	warnx(_("CD-ROM select speed command not supported by this kernel"));
-#endif
 }
 
 /*
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3] logindefs: remove unused function
  2017-11-26 17:47 ` [PATCH 2/3] logindefs: " Sami Kerola
@ 2017-11-28 13:52   ` Karel Zak
  0 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2017-11-28 13:52 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux

On Sun, Nov 26, 2017 at 05:47:50PM +0000, Sami Kerola wrote:
>  login-utils/logindefs.c | 18 ------------------
>  login-utils/logindefs.h |  1 -
>  2 files changed, 19 deletions(-)

All patches applied except this patch. 

I've added free_getlogindefs_data() to su(1) and login(1). It seems
like a good idea to deallocate the config file when we only wait for
child process.

Thanks!

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-28 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-26 17:47 [PATCH 1/3] lib/signames: remove unused function Sami Kerola
2017-11-26 17:47 ` [PATCH 2/3] logindefs: " Sami Kerola
2017-11-28 13:52   ` Karel Zak
2017-11-26 17:47 ` [PATCH 3/3] eject: remove list_speeds() #ifdef CDROM_SELECT_SPEED protection Sami Kerola

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.