Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
e04920db
Commit
e04920db
authored
23 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
66d7b565
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/Socket.cpp
+16
-3
16 additions, 3 deletions
Fltk/Socket.cpp
with
16 additions
and
3 deletions
Fltk/Socket.cpp
+
16
−
3
View file @
e04920db
/* $Id: Socket.cpp,v 1.
9
2001-05-07 07:
3
5:
4
0 geuzaine Exp $ */
/* $Id: Socket.cpp,v 1.
10
2001-05-07 07:
5
5:
0
0 geuzaine Exp $ */
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#ifdef _AIX
#include
<strings.h>
#endif
#include
<sys/types.h>
#include
<sys/socket.h>
#include
<sys/stat.h>
...
...
@@ -78,6 +81,16 @@ void Socket_SendString(int socket, char str[]){
Socket_SendData
(
socket
,
str
,
len
);
}
int
Socket_UnlinkName
(
char
*
name
){
#ifdef _AIX
char
name2
[
1000
];
strcpy
(
name2
,
name
);
name2
[
strlen
(
name2
)
-
1
]
=
'\0'
;
return
unlink
(
name2
);
#else
return
unlink
(
name
);
#endif
}
int
Socket_StartProgram
(
char
*
progname
,
char
*
sockname
){
int
s
,
sock
;
...
...
@@ -93,7 +106,7 @@ int Socket_StartProgram(char *progname, char *sockname){
int
retval
;
/* first delete the socket's name if it exists */
u
nlink
(
sockname
);
Socket_U
nlink
Name
(
sockname
);
/* make the socket */
s
=
socket
(
PF_UNIX
,
SOCK_STREAM
,
0
);
...
...
@@ -145,7 +158,7 @@ int Socket_StartProgram(char *progname, char *sockname){
}
int
Socket_StopProgram
(
char
*
progname
,
char
*
sockname
,
int
sock
){
if
(
u
nlink
(
sockname
)
==-
1
)
Msg
(
WARNING
,
"Impossible to unlink the socket"
);
if
(
Socket_U
nlink
Name
(
sockname
)
==-
1
)
Msg
(
WARNING
,
"Impossible to unlink the socket"
);
close
(
sock
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment