[PATCH] cifs.upcall: switch to getopt_long

View: New views
3 Messages — Rating Filter:   Alert me  

[PATCH] cifs.upcall: switch to getopt_long

by Jeff Layton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

...to allow long option names.

Signed-off-by: Jeff Layton <jlayton@...>
---
 client/cifs.upcall.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/client/cifs.upcall.c b/client/cifs.upcall.c
index c89df9c..f06d563 100644
--- a/client/cifs.upcall.c
+++ b/client/cifs.upcall.c
@@ -27,6 +27,7 @@ create dns_resolver * * /usr/local/sbin/cifs.upcall %k
 
 #include "includes.h"
 #include <keyutils.h>
+#include <getopt.h>
 
 #include "cifs_spnego.h"
 
@@ -357,6 +358,11 @@ usage(void)
  fprintf(stderr, "Usage: %s [-v] key_serial\n", prog);
 }
 
+const struct option long_options[] = {
+ { "version", 0, NULL, 'v' },
+ { NULL, 0, NULL, 0 }
+};
+
 int main(const int argc, char *const argv[])
 {
  struct cifs_spnego_msg *keydata = NULL;
@@ -374,7 +380,7 @@ int main(const int argc, char *const argv[])
 
  openlog(prog, 0, LOG_DAEMON);
 
- while ((c = getopt(argc, argv, "cv")) != -1) {
+ while ((c = getopt_long(argc, argv, "cv", long_options, NULL)) != -1) {
  switch (c) {
  case 'c':
  /* legacy option -- skip it */
--
1.6.2.5

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: [PATCH] cifs.upcall: switch to getopt_long

by Jeff Layton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 19 Aug 2009 13:28:45 -0400
Jeff Layton <jlayton@...> wrote:

> ...to allow long option names.
>
> Signed-off-by: Jeff Layton <jlayton@...>
> ---
>  client/cifs.upcall.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>

Pushed to samba master branch.

--
Jeff Layton <jlayton@...>
_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client

Re: [PATCH] cifs.upcall: switch to getopt_long

by simo-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-08-26 at 06:28 -0400, Jeff Layton wrote:

> On Wed, 19 Aug 2009 13:28:45 -0400
> Jeff Layton <jlayton@...> wrote:
>
> > ...to allow long option names.
> >
> > Signed-off-by: Jeff Layton <jlayton@...>
> > ---
> >  client/cifs.upcall.c |    8 +++++++-
> >  1 files changed, 7 insertions(+), 1 deletions(-)
> >
>
> Pushed to samba master branch.


Good job!

Simo.

--
Simo Sorce
Samba Team GPL Compliance Officer <simo@...>
Principal Software Engineer at Red Hat, Inc. <simo@...>

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@...
https://lists.samba.org/mailman/listinfo/linux-cifs-client