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 151711 Details for
Bug 219750
Hotplug script not working in gpsd package.
[?]
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.
A small C program to talk to gpsd using a socket.
gps-ctrl.c (text/plain), 1.96 KB, created by
Mikkel L. Ellertson
on 2007-04-04 20:44:33 UTC
(
hide
)
Description:
A small C program to talk to gpsd using a socket.
Filename:
MIME Type:
Creator:
Mikkel L. Ellertson
Created:
2007-04-04 20:44:33 UTC
Size:
1.96 KB
patch
obsolete
>/**************************************************************************** > > This is a small program to talk to gpsd when using the control-socket option. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > > *************************************************************************** */ > >#include <sys/types.h> >#include <sys/socket.h> >#include <sys/un.h> >#include <stdio.h> >#include <unistd.h> > >void error(char *); >void exit(int); >int main(int argc, char *argv[]); > >int main(int argc, char *argv[]) >{ > int fd; > int sname_len, r_len; > struct sockaddr_un gps_addr; > char buffer[82]; > > if (argc != 3) > { > fprintf(stderr, "usage %s <gpsd socket> <command>\n", argv[0]); > return 2; > } > if (strlen(argv[2]) >= sizeof(buffer)) > { > fprintf(stderr, "Command too long.\n"); > return 3; > } > bzero((char *)&gps_addr, sizeof(gps_addr)); > gps_addr.sun_family = PF_LOCAL; > strcpy(gps_addr.sun_path, argv[1]); > sname_len = strlen(gps_addr.sun_path) + sizeof(gps_addr.sun_family); > if ((fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) > { > error("Creating socket"); > } > if (connect(fd, (struct sockaddr *) &gps_addr, sname_len) < 0) > { > error("Connecting"); > } > strcpy(buffer, argv[2]); > write(fd, buffer, strlen(buffer)); > r_len = read(fd, buffer, 80); > buffer[r_len] = 0; > printf("%s\n", buffer); > return 0; >} > >void error(char *msg) >{ > perror(msg); > exit(1); >}
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 219750
:
143734
|
149046
|
150680
| 151711 |
151712
|
151713
|
199961