mkfs.c (20061) | mkfs.c (21786) |
---|---|
1/* 2 * Copyright (c) 1980, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 169 unchanged lines hidden (view full) --- 178 } 179 membase = mmap( 180 0, 181 fssize * sectorsize, 182 PROT_READ|PROT_WRITE, 183 MAP_SHARED, 184 fd, 185 0); | 1/* 2 * Copyright (c) 1980, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 169 unchanged lines hidden (view full) --- 178 } 179 membase = mmap( 180 0, 181 fssize * sectorsize, 182 PROT_READ|PROT_WRITE, 183 MAP_SHARED, 184 fd, 185 0); |
186 if((int)membase == -1) { | 186 if(membase == MAP_FAILED) { |
187 perror("mmap"); 188 exit(12); 189 } 190 close(fd); 191 } else { 192 if (fssize * sectorsize > memleft) 193 fssize = (memleft - 16384) / sectorsize; 194 if ((membase = malloc(fssize * sectorsize)) == 0) --- 1107 unchanged lines hidden --- | 187 perror("mmap"); 188 exit(12); 189 } 190 close(fd); 191 } else { 192 if (fssize * sectorsize > memleft) 193 fssize = (memleft - 16384) / sectorsize; 194 if ((membase = malloc(fssize * sectorsize)) == 0) --- 1107 unchanged lines hidden --- |