Changeset 24887


Ignore:
Timestamp:
2011-01-03T13:30:19+01:00 (7 years ago)
Author:
acoul
Message:

tools/mkimage: fix compilation on FreeBSD

Location:
trunk/tools/mkimage/patches
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/tools/mkimage/patches/010-freebsd-ulong-fix.patch

    r24809 r24887  
    1 --- a/tools/kwbimage.c 
    2 +++ b/tools/kwbimage.c 
    3 @@ -206,6 +206,30 @@ INVL_DATA: 
    4         exit (EXIT_FAILURE); 
    5  } 
    6   
    7 +#ifndef __GLIBC__ 
    8 +#ifndef __FreeBSD__ 
    9 +static ssize_t 
    10 +getline(char **line, size_t *len, FILE *fd) 
    11 +{ 
    12 +       char *tmp; 
    13 +       int tmplen; 
    14 + 
    15 +       tmp = fgetln(fd, &tmplen); 
    16 +       if (!tmp) 
    17 +               return -1; 
    18 + 
    19 +       if (!*line || tmplen > *len) { 
    20 +               *len = tmplen + 1; 
    21 +               *line = realloc(*line, *len); 
    22 +       } 
    23 + 
    24 +       strncpy(*line, tmp, tmplen); 
    25 +       line[tmplen] = 0; 
    26 +       return tmplen; 
    27 +} 
    28 +#endif 
    29 +#endif 
    30 + 
    31  /* 
    32   * this function sets the kwbimage header by- 
    33   *     1. Abstracting input command line arguments data 
    341--- a/include/image.h 
    352+++ b/include/image.h 
Note: See TracChangeset for help on using the changeset viewer.