Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
d0d83805
Commit
d0d83805
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Patches
Plain Diff
cleanup {Windows,Unix}/Process.inc
parent
ab450a6b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/lib/Support/Unix/Process.inc
+0
-46
0 additions, 46 deletions
llvm/lib/Support/Unix/Process.inc
llvm/lib/Support/Windows/Process.inc
+0
-28
0 additions, 28 deletions
llvm/lib/Support/Windows/Process.inc
with
0 additions
and
74 deletions
llvm/lib/Support/Unix/Process.inc
+
0
−
46
View file @
d0d83805
...
...
@@ -255,18 +255,6 @@ std::error_code Process::SafelyCloseFileDescriptor(int FD) {
return
std
::
error_code
(
EC
,
std
::
generic_category
());
}
bool
Process
::
StandardInIsUserInput
()
{
return
FileDescriptorIsDisplayed
(
STDIN_FILENO
);
}
bool
Process
::
StandardOutIsDisplayed
()
{
return
FileDescriptorIsDisplayed
(
STDOUT_FILENO
);
}
bool
Process
::
StandardErrIsDisplayed
()
{
return
FileDescriptorIsDisplayed
(
STDERR_FILENO
);
}
bool
Process
::
FileDescriptorIsDisplayed
(
int
fd
)
{
#if HAVE_ISATTY
return
isatty
(
fd
);
...
...
@@ -276,40 +264,6 @@ bool Process::FileDescriptorIsDisplayed(int fd) {
#endif
}
static
unsigned
getColumns
(
int
FileID
)
{
// If COLUMNS is defined in the environment, wrap to that many columns.
if
(
const
char
*
ColumnsStr
=
std
::
getenv
(
"COLUMNS"
))
{
int
Columns
=
std
::
atoi
(
ColumnsStr
);
if
(
Columns
>
0
)
return
Columns
;
}
unsigned
Columns
=
0
;
#if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H)
// Try to determine the width of the terminal.
struct
winsize
ws
;
if
(
ioctl
(
FileID
,
TIOCGWINSZ
,
&
ws
)
==
0
)
Columns
=
ws
.
ws_col
;
#endif
return
Columns
;
}
unsigned
Process
::
StandardOutColumns
()
{
if
(
!
StandardOutIsDisplayed
())
return
0
;
return
getColumns
(
1
);
}
unsigned
Process
::
StandardErrColumns
()
{
if
(
!
StandardErrIsDisplayed
())
return
0
;
return
getColumns
(
2
);
}
#ifdef HAVE_TERMINFO
// We manually declare these extern functions because finding the correct
// headers from various terminfo, curses, or other sources is harder than
...
...
This diff is collapsed.
Click to expand it.
llvm/lib/Support/Windows/Process.inc
+
0
−
28
View file @
d0d83805
...
...
@@ -257,39 +257,11 @@ std::error_code Process::SafelyCloseFileDescriptor(int FD) {
return
std
::
error_code
();
}
bool
Process
::
StandardInIsUserInput
()
{
return
FileDescriptorIsDisplayed
(
0
);
}
bool
Process
::
StandardOutIsDisplayed
()
{
return
FileDescriptorIsDisplayed
(
1
);
}
bool
Process
::
StandardErrIsDisplayed
()
{
return
FileDescriptorIsDisplayed
(
2
);
}
bool
Process
::
FileDescriptorIsDisplayed
(
int
fd
)
{
DWORD
Mode
;
// Unused
return
(
GetConsoleMode
((
HANDLE
)
_get_osfhandle
(
fd
),
&
Mode
)
!=
0
);
}
unsigned
Process
::
StandardOutColumns
()
{
unsigned
Columns
=
0
;
CONSOLE_SCREEN_BUFFER_INFO
csbi
;
if
(
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
&
csbi
))
Columns
=
csbi
.
dwSize
.
X
;
return
Columns
;
}
unsigned
Process
::
StandardErrColumns
()
{
unsigned
Columns
=
0
;
CONSOLE_SCREEN_BUFFER_INFO
csbi
;
if
(
GetConsoleScreenBufferInfo
(
GetStdHandle
(
STD_ERROR_HANDLE
),
&
csbi
))
Columns
=
csbi
.
dwSize
.
X
;
return
Columns
;
}
// The terminal always has colors.
bool
Process
::
FileDescriptorHasColors
(
int
fd
)
{
return
FileDescriptorIsDisplayed
(
fd
);
...
...
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