tabs to spaces
This commit is contained in:
parent
67e65f7664
commit
ca1abea3ea
|
|
@ -23,7 +23,7 @@ static void string_free (void * entry)
|
||||||
{
|
{
|
||||||
char **s=entry;
|
char **s=entry;
|
||||||
if(*s!=NULL)
|
if(*s!=NULL)
|
||||||
free(*s);
|
free(*s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int string_compare (const void *e1,const void *e2)
|
static int string_compare (const void *e1,const void *e2)
|
||||||
|
|
@ -37,7 +37,7 @@ static int string_compare (const void *e1,const void *e2)
|
||||||
{
|
{
|
||||||
return strcmp(*s1,*s2);
|
return strcmp(*s1,*s2);
|
||||||
}else
|
}else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argv,char **argc)
|
int main(int argv,char **argc)
|
||||||
|
|
|
||||||
|
|
@ -23,40 +23,40 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
if(argc<3)
|
if(argc<3)
|
||||||
{
|
{
|
||||||
printf("Makes a large file with hole using fseeko\n");
|
printf("Makes a large file with hole using fseeko\n");
|
||||||
printf("%s <filename> <floating point size in GB>\n",argv[0]);
|
printf("%s <filename> <floating point size in GB>\n",argv[0]);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
fd = fopen(argv[1],"w");
|
fd = fopen(argv[1],"w");
|
||||||
if(fd == NULL)
|
if(fd == NULL)
|
||||||
{
|
{
|
||||||
perror("fopen");
|
perror("fopen");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
size=atof(argv[2]);
|
size=atof(argv[2]);
|
||||||
#if SIZEOF_OFF_T <= 4
|
#if SIZEOF_OFF_T <= 4
|
||||||
if(size>2)
|
if(size>2)
|
||||||
{
|
{
|
||||||
printf("You do not have LFS your system.\nMaximum supported filesize is 2 GB.\n");
|
printf("You do not have LFS your system.\nMaximum supported filesize is 2 GB.\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pos=size*GB;
|
pos=size*GB;
|
||||||
if(fseeko(fd,pos,SEEK_SET))
|
if(fseeko(fd,pos,SEEK_SET))
|
||||||
{
|
{
|
||||||
perror("fseeko");
|
perror("fseeko");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(fwrite("!",1,1,fd)<1)
|
if(fwrite("!",1,1,fd)<1)
|
||||||
{
|
{
|
||||||
perror("write");
|
perror("write");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(fclose(fd))
|
if(fclose(fd))
|
||||||
{
|
{
|
||||||
perror("fclose");
|
perror("fclose");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user