delivered the opinion of the court.
On July 13, 1942, William G. Midgett, hereinafter designated petitioner, was convicted in the Circuit Court of Princess Anne County on eight indictments, six charged him with grand larceny and two with housebreaking. He was sentenced on each indictment to two years’ сonfinement in the penitentiary, the sentences to run consecutively, making his total period of confinement 16 years.
On March 20, 1956, petitioner filed a petition in the lower court for a writ of habeas corpus against W. Frank Smyth, Jr., Superintendent of the State Penitentiary, hereinafter designated respondent. It was alleged in the petition that the eight judgments of conviction, pronounced against petitioner by the Circuit Court of Princess Anne County, were invalid becаuse in each of the eight trials he was denied rights guaranteed him by the Fifth and Fourteenth Amendments to the Federal Constitution.
The lower court entered an order requiring respondent to show cause why a writ of habeas corpus should not be enterеd. Respondent answered the rale to show cause and after a writ of habeas corpus had been issued, filed an additional answer, together with certain exhibits, denying that any of the eight convictions pronounced against petitionеr by the Circuit Court of Princess Anne County was void. The exhibits included the following report of Curtis R. Mann, Director of the Bureau of Records and Criminal Identification:
“Re: William C. Midgett, Va. Pen. #46994
“The six (6) Grand Larceny charges, the two (2) Housebreaking charges, and the thrеe (3) Escape charges expired or will expire in the following manner:
“(At large on escape 7 yrs.-6 mos,-10 das.)
*729![]()
The lower court heard the evidence introduced by the respective parties on the issues raised by the pleadings and entered an order releasing petitioner from custody. From that order respondent obtained this writ of error.
At the threshold of the case we are confronted with petitioner’s motion to dismiss the writ of error on the ground that respondent did not have the evidence introduced at the hearing transcribed and made a part of the record before this Court.
When the evidence introduced in the lower court is not made a part of the record on appeal, all questions of fact resolved by that court must be accepted as conclusive. But this Court will consider any question of law properly raised as to matters appearing on the face of the record. In this case the record consists of the pleadings, exhibits filed therewith and the orders of the lower court, which record is sufficient for the Court to pass on the questions of law raised by respondent. The motiоn to dismiss is overruled.
The court stated in its order that, “* * * it appearing from the exhibit filed with the petition [answer] that the petitioner has been three times convicted of escape and sentenced to a term of one year in the Virginia State Penitentiary for each such offense and it further appearing from said exhibit that subsequent to the date of each such conviction the petitioner has served at least one year’s confinement in said institution allegedly upon a conviction declared void by this order, the Court doth ADJUDGE, ORDER and DECREE that the several trials had on July 13, 1942, in the Circuit Court of Princess Anne County are null and void and that the petitioner has served sufficient time to satisfy each of the said escape convictions and should be credited with time served subsequent to such convictions and the respondent is therefore ordered to release the petitioner frоm custody; * * *."
The legal question presented is whether a court has jurisdiction in a habeas corpus proceeding to give a prisoner credit on valid sen *730 tences, which he had not begun to serve when the petition was filed, for time he had served on void sentences.
Habeas corpus
is a writ of inquiry granted to determine whether a person is illegally detained. Code, § 8-596. It can not be used to perform the function of an appeal or writ of error, to review errors, or to modify or revise a judgment of conviction pronounced by а court of competent jurisdiction. It can not be used to secure a judicial determination of any question which, even if determined in the prisoner’s favor, could not affect the lawfulness of his immediate custody and detention. In other words, a prisoner is entitled to immediate release by
habeas corpus
if he is presently restrained of his liberty without warrant of law.
Buchanan
v.
Buchanan,
A persоn convicted on a criminal charge is entitled to have deducted from his sentence of confinement all time actually spent by him in jail or in the penitentiary awaiting trial, or pending an appeal of that cоnviction. “No such credit, however, shall be given to any person who shall break jail or escape.” Code, § 53-208;
Hale
v.
Commonwealth,
A court does not have jurisdiction to determine the validity of a sentence under which the prisoner is not bеing detained. It follows that where a prisoner is being detained under a valid sentence he is not entitled to'credit for time served on a void sentence fully served before the proceeding for writ of
habeas corpus
is instituted.
McDorman
v.
Smyth,
The facts in the Holland case, supra, were that Holland, the prisoner, had been convicted of three felonies, two by the Cоrporation Court of the City of Norfolk in January 1935, one of which was for armed robbery, and sentenced to confinement in the pen *731 itentiary for a period of 25 years, and the other for theft of an automobile for which he was sentenced to serve one year in the penitentiary, making a total of 26 years. On March 5, 1935, Holland was tried in the Corporation Court of the City of Danville upon an indictment charging grand larceny and sentenced to six years in the penitentiary. On December 5, 1955, he filed a petition in the lower court for a writ of habeas corpus on the ground that the three judgments of conviction were void. It appeared from the answer filed to the petition that Holland had fully served the two sentences imposed on him by the Corporation Court of the City of Norfolk and that he was then serving the six year sentence imposed by the Corporation Court of the City of Danville. The lower court in its order held that the judgment of conviction for armed robbery in the Corporation Court of the City of Norfolk was void and that the time served thereunder by Holland should be credited upon the valid conviction pronounced against him by the Corporation Court of the City of Danville, which he was then serving. In reversing this order, Mr. Justice Spratley, speaking for the Court, said:
“We find no statute or authority, nor have we been cited to any, which authorized or empowered the Hustings Court of the City of Richmond, Part II, to order that the time of the sentence for armed robbery, fully served by the petitioner, prior to the institution of this proceeding, be credited as served upon other sentences, under which he is being presently held in custody.”199 Va., at page 99 .
In
McDorman
v.
Smyth,
*732 “We conclude that while petitioner is entitled to be released from custody under the sentence of March 9, 1932, he is not entitled to be released from detention until he has completed the sentence of one year imposed on him on March 12, 1947. However, on the last mentioned sentence, he should receive proper credit for the time he has served since May 24, 1948, the expiration of the valid sentence for which he had been held, and allowance for good conduct if, under pertinent rules and regulations of State authorities, he is еntitled to such credit. It is so ordered.”188 Va., at page 484 .
Where it appears from judgments of conviction that different sentences are to run consecutively, and not concurrently, a prisoner serves only one sentence at а time. From the exhibit filed with respondent’s answer and the order of the court, it appears that petitioner had completely served three of the sentences imposed for grand larceny and that the third sentence expired on May 2, 1955. When the petition for writ of habeas corpus was filed on March 20, 1956, petitioner was being detained under the fourth conviction for grand larceny, which began to run on May 3, 1955 and was due to expire on September 2, 1956.
The lоwer court did not have jurisdiction in this proceeding to determine the validity of the three convictions that petitioner had completely served before filing his petition. It follows that the lower court erred insofar as it gave petitioner credit for the time served under the completed sentences. However, petitioner is entitled to credit on the three valid escape convictions for the time served since May 2, 1955, thе date he began serving the void sentence under which he was being detained at the time he filed his petition for a writ of habeas corpus. In other words, when the lower court determined that petitioner was being detained under a void conviction he was entitled to his immediate release from custody on that sentence. But when respondent proved that there were other valid sentences which petitioner had not served, he was not entitled to be released until these had been served, or unless he had served sufficient time under the void sentence that began on May 3, 1955 to satisfy the valid sentences.
Since it appears from the order of the court that it gave pеtitioner credit on his valid convictions for time served under the convictions that had been completely served prior to March 20, 1956, the date of filing his petition, the order will be modified by disallowing this credit, and the case rеmanded for the lower court to determine the *733 proper credit to be given for the time served by petitioner since May 2, 1955, including allowance for good conduct time to which he may be entitled. If such credit is sufficient to satisfy the three convictions for escape, petitioner should be released forthwith from custody thereunder. It is so ordered.
Modified and remanded.
