The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / nfs-utils / 0003-Switch-legacy-index-in-favour-of-strchr.patch
1 From 636e78e4c9bc8be174805bde2f3ae7f940dc3d0e Mon Sep 17 00:00:00 2001
2 From: Gustavo Zacarias <gustavo@zacarias.com.ar>
3 Date: Sat, 10 Nov 2012 18:58:15 +0100
4 Subject: [PATCH] Switch legacy index() in favour of strchr() Updated for
5  1.2.6 from the previous patch by Frederik Pasch.
6
7 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
8 ---
9  support/nfs/nfs_mntent.c |    6 +++---
10  utils/mount/error.c      |    2 +-
11  utils/mountd/fsloc.c     |    2 +-
12  3 files changed, 5 insertions(+), 5 deletions(-)
13
14 diff --git a/support/nfs/nfs_mntent.c b/support/nfs/nfs_mntent.c
15 index a2118a2..7496ed6 100644
16 --- a/support/nfs/nfs_mntent.c
17 +++ b/support/nfs/nfs_mntent.c
18 @@ -9,7 +9,7 @@
19   */
20  
21  #include <stdio.h>
22 -#include <string.h>            /* for index */
23 +#include <string.h>            /* for strchr */
24  #include <ctype.h>             /* for isdigit */
25  #include <sys/stat.h>          /* for umask */
26  #include <unistd.h>            /* for ftruncate */
27 @@ -172,7 +172,7 @@ nfs_getmntent (mntFILE *mfp) {
28                         return NULL;
29  
30                 mfp->mntent_lineno++;
31 -               s = index (buf, '\n');
32 +               s = strchr (buf, '\n');
33                 if (s == NULL) {
34                         /* Missing final newline?  Otherwise extremely */
35                         /* long line - assume file was corrupted */
36 @@ -180,7 +180,7 @@ nfs_getmntent (mntFILE *mfp) {
37                                 fprintf(stderr, _("[mntent]: warning: no final "
38                                         "newline at the end of %s\n"),
39                                         mfp->mntent_file);
40 -                               s = index (buf, 0);
41 +                               s = strchr (buf, 0);
42                         } else {
43                                 mfp->mntent_errs = 1;
44                                 goto err;
45 diff --git a/utils/mount/error.c b/utils/mount/error.c
46 index 83ad1d2..428deef 100644
47 --- a/utils/mount/error.c
48 +++ b/utils/mount/error.c
49 @@ -62,7 +62,7 @@ static int rpc_strerror(int spos)
50         char *tmp;
51  
52         if (estr) {
53 -               if ((ptr = index(estr, ':')))
54 +               if ((ptr = strchr(estr, ':')))
55                         estr = ++ptr;
56  
57                 tmp = &errbuf[spos];
58 diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c
59 index bc737d1..ddbe92f 100644
60 --- a/utils/mountd/fsloc.c
61 +++ b/utils/mountd/fsloc.c
62 @@ -127,7 +127,7 @@ static struct servers *method_list(char *data)
63         bool v6esc = false;
64  
65         xlog(L_NOTICE, "method_list(%s)", data);
66 -       for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
67 +       for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
68                 ptr++;
69         list = malloc(listsize * sizeof(char *));
70         copy = strdup(data);
71 -- 
72 1.7.9.5
73