Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 289750 Details for
Bug 425911
GFS1 with GULM fails to get a posix lock correctly.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Test lock file
filetest.c (text/x-csrc), 1.17 KB, created by
Wade Mealing
on 2007-12-17 07:20:44 UTC
(
hide
)
Description:
Test lock file
Filename:
MIME Type:
Creator:
Wade Mealing
Created:
2007-12-17 07:20:44 UTC
Size:
1.17 KB
patch
obsolete
>#include <stdio.h> >#include <fcntl.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <stdlib.h> >#include <errno.h> > > >int main( int argc, char** argv) { > > >char* fname; >int done; >int i,handle; >int ret; >struct flock lock; > > >if ( argc != 2 ) { > > fprintf(stdout, "Usage: FileTest <path/filename>\n"); > exit(0); >} > >fprintf(stdout, "Opening handle for file: %s\n", argv[1]); > >handle = open( argv[1], O_RDWR | O_CREAT | O_SYNC, S_IRUSR | S_IWUSR ); > >if (handle == -1) { > fprintf(stderr, "Error from open(): %d\n", errno); > exit(1) ; >} > > > >fprintf(stdout, "Trying to acquire file lock!\n"); > > > > ret = -1; > lock.l_type = F_WRLCK; > lock.l_start = 0; > lock.l_whence = SEEK_SET; /* from beginning of file */ > lock.l_len = 1; /* lock first byte */ > ret = fcntl(handle,F_SETLK,&lock); > > if (ret != 0) { > > close(handle); > fprintf(stderr, "Error from fcntl() for file locking: %d\n", errno); > exit(1); > > } > > > fprintf(stdout, "Lock obtained!\n"); > fprintf(stdout, "Terminate with ^C for ungraceful shutdown or enter to continue.\n"); > i = getchar(); > fprintf(stdout, "Shut down gracefully!\n"); > close(handle); > > > exit(0); > > >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 425911
: 289750