Fix file create mode in FileSink endpoint, the file should be created with default 0666 mask, this allows the user to manage permissions with umask fixes issue #74
This commit is contained in:
		
							parent
							
								
									96a104d15e
								
							
						
					
					
						commit
						aebe9b4254
					
				| 
						 | 
				
			
			@ -217,8 +217,10 @@ FileSink :: create ( void )                     throw ( Exception )
 | 
			
		|||
    if ( isOpen() ) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ( (fd = ::creat( fileName, S_IRUSR | S_IWUSR)) == -1 ) {
 | 
			
		||||
    /* filemode default to 0666 */
 | 
			
		||||
    const int filemode = (S_IRUSR|S_IWUSR|S_IWGRP|S_IRGRP|S_IROTH|S_IWOTH) ;
 | 
			
		||||
    /* create the file */
 | 
			
		||||
    if ( (fd = ::creat( fileName, filemode )) == -1 ) {
 | 
			
		||||
        reportEvent( 3, "can't create file", fileName, errno);
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue