Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
epics-modules
require
Commits
fdbd6210
Commit
fdbd6210
authored
20 years ago
by
zimoch
Browse files
Options
Downloads
Patches
Plain Diff
abort when ld fails; text existence of dbd file
parent
3167af91
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
require.c
+23
-9
23 additions, 9 deletions
require.c
with
23 additions
and
9 deletions
require.c
+
23
−
9
View file @
fdbd6210
#include
<symLib.h>
#include
<sysSymTbl.h>
#include
<stdio.h>
#include
<string.h>
#include
<sysLib.h>
#include
<shellLib.h>
#include
<usrLib.h>
#include
<taskLib.h>
#include
<stat.h>
#include
<stdio.h>
#include
<string.h>
int
dbLoadDatabase
(
char
*
filename
,
char
*
path
,
char
*
substitutions
);
...
...
@@ -15,6 +18,7 @@ int require(char* lib, char* version)
char
**
path
;
char
*
loaded
;
SYM_TYPE
type
;
struct
stat
filestat
;
if
(
symFindByName
(
sysSymTbl
,
"LIB"
,
(
char
**
)
&
path
,
&
type
)
!=
OK
)
{
...
...
@@ -45,16 +49,24 @@ int require(char* lib, char* version)
/* Load library and dbd file of requested version */
if
(
ld
(
0
,
0
,
libname
)
==
NULL
)
{
printf
(
"%s not loaded
\n
"
,
libname
);
printf
(
"Aborting startup stript.
\n
"
);
shellScriptAbort
();
return
ERROR
;
}
printf
(
"%s loaded
\n
"
,
libname
);
if
(
dbLoadDatabase
(
dbdname
,
NULL
,
NULL
)
!=
OK
)
symFindByName
(
sysSymTbl
,
symbol
,
&
loaded
,
&
type
);
printf
(
"%sLib-%s loaded
\n
"
,
lib
,
loaded
);
if
(
stat
(
dbdname
,
&
filestat
)
!=
ERROR
)
{
printf
(
"%s not loaded
\n
"
,
dbdname
);
return
ERROR
;
/* If file exists */
if
(
dbLoadDatabase
(
dbdname
,
NULL
,
NULL
)
!=
OK
)
{
taskDelay
(
sysClkRateGet
());
printf
(
"Aborting startup stript.
\n
"
);
shellScriptAbort
();
return
ERROR
;
}
printf
(
"dbd/%s-%s.dbd loaded
\n
"
,
lib
,
loaded
);
}
printf
(
"%s loaded
\n
"
,
dbdname
);
return
OK
;
}
else
...
...
@@ -72,7 +84,9 @@ int require(char* lib, char* version)
||
(
matches
>=
2
&&
minor
!=
lminor
)
||
(
matches
>
2
&&
patch
!=
lpatch
))
{
printf
(
"Conflict between requested %s
\n
and already loaded version %s
\n
"
,
printf
(
"Conflict between requested %s
\n
"
"and already loaded version %s.
\n
"
"Aborting startup stript.
\n
"
,
libname
,
loaded
);
shellScriptAbort
();
return
ERROR
;
...
...
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