/[hurd]/hurd/libdiskfs/file-get-trans.c
ViewVC logotype

Diff of /hurd/libdiskfs/file-get-trans.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by tb, Sun Jul 11 05:28:44 1999 UTC revision 1.23 by roland, Wed May 8 09:57:08 2002 UTC
# Line 1  Line 1 
1  /* libdiskfs implementation of fs.defs: file_get_translator  /* libdiskfs implementation of fs.defs: file_get_translator
2     Copyright (C) 1992,93,94,95,96,98,99 Free Software Foundation, Inc.     Copyright (C) 1992,93,94,95,96,98,99,2002 Free Software Foundation, Inc.
3    
4     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
5     modify it under the terms of the GNU General Public License as     modify it under the terms of the GNU General Public License as
# Line 25  Line 25 
25  kern_return_t  kern_return_t
26  diskfs_S_file_get_translator (struct protid *cred,  diskfs_S_file_get_translator (struct protid *cred,
27                                char **trans,                                char **trans,
28                                u_int *translen)                                size_t *translen)
29  {  {
30    struct node *np;    struct node *np;
31    error_t error = 0;    error_t error = 0;
# Line 41  diskfs_S_file_get_translator (struct pro Line 41  diskfs_S_file_get_translator (struct pro
41    if (S_ISLNK (np->dn_stat.st_mode))    if (S_ISLNK (np->dn_stat.st_mode))
42      {      {
43        unsigned int len = sizeof _HURD_SYMLINK + np->dn_stat.st_size + 1;        unsigned int len = sizeof _HURD_SYMLINK + np->dn_stat.st_size + 1;
44        int amt;        size_t amt;
45        assert (diskfs_shortcut_symlink);        assert (diskfs_shortcut_symlink);
46        if (len > *translen)        if (len > *translen)
47          *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);          *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
# Line 107  diskfs_S_file_get_translator (struct pro Line 107  diskfs_S_file_get_translator (struct pro
107    
108        len = sizeof _HURD_IFSOCK;        len = sizeof _HURD_IFSOCK;
109        if (len > *translen)        if (len > *translen)
110          *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);              *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
111        bcopy (_HURD_IFSOCK, *trans, sizeof _HURD_IFSOCK);        bcopy (_HURD_IFSOCK, *trans, sizeof _HURD_IFSOCK);
112        *translen = len;        *translen = len;
113        error = 0;        error = 0;

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26